Skip to content

Commit 9d3eb6d

Browse files
committed
[skip-ci][win] Fix compiler flags workarounds
Those workarounds are not needed anymore with the latest VS 2019 and VS 2022
1 parent 7d83afa commit 9d3eb6d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

core/base/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# CMakeLists.txt file for building ROOT core/base package
99
############################################################################
1010

11-
if(MSVC AND MSVC_VERSION GREATER_EQUAL 1925)
11+
if(MSVC AND MSVC_VERSION GREATER_EQUAL 1925 AND MSVC_VERSION LESS 1929)
1212
# FIXME: since Visual Studio v16.5.0 the /O2 optimization flag makes most of the roofit/roostats tests failing
1313
# Try to re-enable /O2 after the upgrade of llvm & clang, or when upgrading Visual Studio
1414
string(REPLACE "-O2" "-O1 -Oi" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")

hist/histv7/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# For the list of contributors see $ROOTSYS/README/CREDITS.
66

77
if(MSVC)
8-
if(MSVC_VERSION GREATER_EQUAL 1923)
8+
if(MSVC_VERSION GREATER_EQUAL 1923 AND MSVC_VERSION LESS 1929)
99
# FIXME: using /O2 compiler flag prevent the following error when building in debug mode:
1010
# axis.obj : fatal error LNK1179: invalid or corrupt file: duplicate COMDAT
1111
# '??$?8DU?$char_traits@D@std@@@__ROOT@experimental@std@@YA_NV?$basic_string_view@DU?$char_traits@D@std@@@012@0@Z'

interpreter/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ if(MSVC)
106106
string(REPLACE "-O2" "-O1 -Oi" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
107107
string(REPLACE "-O2" "-O1 -Oi" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
108108
# replace dashes in the -EH* and -GR* flags with slashes (/EH* /GR*)
109-
string(REPLACE " -EH" " /EH" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
110-
string(REPLACE " -GR" " /GR" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
109+
if (MSVC_VERSION GREATER_EQUAL 1924 AND MSVC_VERSION LESS 1929)
110+
string(REPLACE " -EH" " /EH" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
111+
string(REPLACE " -GR" " /GR" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
112+
endif()
111113
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4049,4206,4217,4221")
112114
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ignore:4049,4206,4217,4221")
113115
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /ignore:4049,4206,4217,4221")

0 commit comments

Comments
 (0)