Skip to content

Commit d1499d9

Browse files
authored
Merge pull request #2531 from BioDataAnalysis/bda_improve_win_support
Minor improvements for Windows (MSVC, ClangCl) support
2 parents 03d21d3 + 7efb01d commit d1499d9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

benchmark/CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"
2828
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
2929
endif()
3030
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -g -Wunused-parameter -Wextra -Wreorder")
31-
CHECK_CXX_COMPILER_FLAG("-std=c++14" HAS_CPP14_FLAG)
3231

33-
if (HAS_CPP14_FLAG)
34-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
35-
else()
36-
message(FATAL_ERROR "Unsupported compiler -- xtensor requires C++14 support!")
32+
if(NOT "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
33+
CHECK_CXX_COMPILER_FLAG("-std=c++14" HAS_CPP14_FLAG)
34+
if (HAS_CPP14_FLAG)
35+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
36+
else()
37+
message(FATAL_ERROR "Unsupported compiler -- xtensor requires C++14 support!")
38+
endif()
3739
endif()
3840

3941
# Enable link time optimization and set the default symbol

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
111111
endif()
112112
else() # We are using clang-cl
113113
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_cxx_std_flag} /bigobj")
114-
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO)
114+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
115115
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
116116
add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
117117
if (XTENSOR_DISABLE_EXCEPTIONS)

0 commit comments

Comments
 (0)