Skip to content

Commit b92cbb9

Browse files
authored
[win] Remove compiler flags workarounds (#9829)
* [skip-ci][win] Fix compiler flags workarounds Those workarounds are not needed anymore with the latest VS 2019 and VS 2022 * Fix the correct lines * Fix failing test Fix a test failing due to the removal of compiler flags workarounds * Revert "Fix failing test" This reverts commit 914d022. * More compiler flags and increase stack size for a couple of tests * Code formatting (white space)
1 parent 5f7a23f commit b92cbb9

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
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
@@ -103,8 +103,10 @@ endif()
103103
if(MSVC)
104104
# FIXME: since Visual Studio v16.4.0 the /O2 optimization flag make many (25%) of the tests failing
105105
# Try to re-enable /O2 after the upgrade of llvm & clang
106-
string(REPLACE "-O2" "-O1 -Oi" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
107-
string(REPLACE "-O2" "-O1 -Oi" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
106+
if (MSVC_VERSION GREATER_EQUAL 1924 AND MSVC_VERSION LESS 1929)
107+
string(REPLACE "-O2" "-O1 -Oi" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
108+
string(REPLACE "-O2" "-O1 -Oi" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
109+
endif()
108110
# replace dashes in the -EH* and -GR* flags with slashes (/EH* /GR*)
109111
string(REPLACE " -EH" " /EH" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
110112
string(REPLACE " -GR" " /GR" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

tree/dataframe/test/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ ROOT_ADD_GTEST(dataframe_regression dataframe_regression.cxx LIBRARIES Physics R
1818
ROOT_ADD_GTEST(dataframe_utils dataframe_utils.cxx LIBRARIES ROOTDataFrame)
1919
ROOT_ADD_GTEST(dataframe_report dataframe_report.cxx LIBRARIES ROOTDataFrame)
2020

21+
if(MSVC)
22+
set_property(TARGET dataframe_cache APPEND_STRING PROPERTY LINK_FLAGS " -STACK:10000000")
23+
set_property(TARGET dataframe_interface APPEND_STRING PROPERTY LINK_FLAGS " -STACK:10000000")
24+
endif()
25+
2126
ROOT_ADD_GTEST(dataframe_splitcoll_arrayview dataframe_splitcoll_arrayview.cxx LIBRARIES ROOTDataFrame)
2227
target_include_directories(dataframe_splitcoll_arrayview PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
2328
ROOT_GENERATE_DICTIONARY(TwoFloatsDict TwoFloats.h MODULE dataframe_splitcoll_arrayview LINKDEF TwoFloatsLinkDef.h OPTIONS -inlineInputHeader)
@@ -49,7 +54,7 @@ ROOT_ADD_GTEST(dataframe_samplecallback dataframe_samplecallback.cxx CounterHelp
4954
ROOT_ADD_GTEST(dataframe_vary dataframe_vary.cxx LIBRARIES ROOTDataFrame)
5055

5156
#### TESTS FOR DIFFERENT DATASOURCES ####
52-
if (MSVC)
57+
if(MSVC AND MSVC_VERSION GREATER_EQUAL 1925 AND MSVC_VERSION LESS 1929)
5358
# TODO: remove this workaround for MS compiler bug #1441527 once fixed
5459
string(REPLACE "-Od -Z7" "-O2" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
5560
string(REPLACE "-Z7" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")

0 commit comments

Comments
 (0)