Skip to content

Commit a128730

Browse files
authored
CMake updates (#576)
1 parent 76deaf5 commit a128730

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
472472
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14)
473473
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
474474
if(BUILD_SHARED_LIBS)
475-
target_compile_options(${PROJECT_NAME} PRIVATE "/wd4251" "/wd4275")
475+
target_compile_options(${PROJECT_NAME} PRIVATE /wd4251 /wd4275)
476476
endif()
477477

478478
if(ENABLE_CODE_ANALYSIS)
@@ -491,10 +491,13 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
491491
endforeach()
492492
endif()
493493

494-
set(WarningsEXE "/wd4365" "/wd4514" "/wd4571" "/wd4625" "/wd4626" "/wd4627" "/wd4710" "/wd4711" "/wd4774" "/wd4820" "/wd5026" "/wd5027" "/wd5039" "/wd5045")
494+
set(WarningsEXE /wd4365 /wd4514 /wd4571 /wd4625 /wd4626 /wd4627 /wd4710 /wd4711 /wd4774 /wd4820 /wd5026 /wd5027 /wd5039 /wd5045)
495495
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
496-
list(APPEND WarningsEXE "/wd5262" "/wd5264")
497-
target_compile_options(${PROJECT_NAME} PRIVATE "/wd5262")
496+
list(APPEND WarningsEXE /wd5262 /wd5264)
497+
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262)
498+
endif()
499+
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.50)
500+
list(APPEND WarningsEXE /wd4865)
498501
endif()
499502
foreach(t IN LISTS TOOL_EXES)
500503
target_compile_options(${t} PRIVATE ${WarningsEXE})

Src/pch.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#ifdef _MSC_VER
1313
// Off by default warnings
14-
#pragma warning(disable : 4619 4616 4061 4265 4365 4571 4623 4625 4626 4628 4668 4710 4711 4746 4774 4820 4987 5026 5027 5031 5032 5039 5045 5219 5264 26812)
14+
#pragma warning(disable : 4619 4616 4061 4265 4365 4571 4623 4625 4626 4628 4668 4710 4711 4746 4774 4820 4865 4987 5026 5027 5031 5032 5039 5045 5219 5264 26812)
1515
// C4619/4616 #pragma warning warnings
1616
// C4061 enumerator 'X' in switch of enum 'X' is not explicitly handled by a case label
1717
// C4265 class has virtual functions, but destructor is not virtual
@@ -27,6 +27,7 @@
2727
// C4746 volatile access of '<expression>' is subject to /volatile:<iso|ms> setting
2828
// C4774 format string expected in argument 3 is not a string literal
2929
// C4820 padding added after data member
30+
// C4865 the underlying type will change from 'int' to 'unsigned int' when '/Zc:enumTypes' is specified on the command line
3031
// C4987 nonstandard extension used
3132
// C5026 move constructor was implicitly defined as deleted
3233
// C5027 move assignment operator was implicitly defined as deleted

build/CompilerAndLinker.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
193193
endif()
194194

195195
if(WINDOWS_STORE AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.32))
196-
list(APPEND COMPILER_SWITCHES "/wd5246")
196+
list(APPEND COMPILER_SWITCHES /wd5246)
197197
endif()
198198

199199
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)

0 commit comments

Comments
 (0)