Skip to content

Commit

Permalink
Windows : small cmake cleanup
Browse files Browse the repository at this point in the history
Use STRING(APPEND VAR...) rather than SET(VAR "${VAR} ..."), it is shorter
  • Loading branch information
vaintroub committed May 18, 2020
1 parent 1f952df commit 21321fc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions cmake/os/Windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -201,25 +201,25 @@ IF(MSVC)
# Mark 32 bit executables large address aware so they can
# use > 2GB address space
IF(CMAKE_SIZEOF_VOID_P MATCHES 4)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
STRING(APPEND CMAKE_EXE_LINKER_FLAGS " /LARGEADDRESSAWARE")
ENDIF()

# Speed up multiprocessor build
IF (NOT CLANG_CL)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
STRING(APPEND CMAKE_C_FLAGS " /MP")
STRING(APPEND CMAKE_CXX_FLAGS " /MP")
ENDIF()

#TODO: update the code and remove the disabled warnings
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4700 /we4311 /we4477 /we4302 /we4090")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /we4099 /we4700 /we4311 /we4477 /we4302 /we4090")
STRING(APPEND CMAKE_C_FLAGS " /we4700 /we4311 /we4477 /we4302 /we4090")
STRING(APPEND CMAKE_CXX_FLAGS " /we4099 /we4700 /we4311 /we4477 /we4302 /we4090")
IF(MSVC_VERSION GREATER 1910 AND NOT CLANG_CL)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-")
STRING(APPEND CMAKE_CXX_FLAGS " /permissive-")
ENDIF()
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNINGS)
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
STRING(APPEND CMAKE_C_FLAGS " /WX")
STRING(APPEND CMAKE_CXX_FLAGS " /WX")
FOREACH(type EXE SHARED MODULE)
FOREACH(cfg RELEASE DEBUG RELWITHDEBINFO)
SET(CMAKE_${type}_LINKER_FLAGS_${cfg} "${CMAKE_${type}_LINKER_FLAGS_${cfg}} /WX")
Expand All @@ -229,9 +229,9 @@ IF(MSVC)
IF(MSVC_VERSION LESS 1910)
# Noisy warning C4800: 'type': forcing value to bool 'true' or 'false' (performance warning),
# removed in VS2017
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800")
STRING(APPEND CMAKE_CXX_FLAGS " /wd4800")
ELSEIF (NOT CLANG_CL)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /d2OptimizeHugeFunctions")
STRING(APPEND CMAKE_CXX_FLAGS " /d2OptimizeHugeFunctions")
ENDIF()
ENDIF()

Expand Down

0 comments on commit 21321fc

Please sign in to comment.