Skip to content

Commit 7efb01d

Browse files
committed
benchmark/CMakeLists.txt: -std=c++14 is not required with clang-cl on MSVC
1 parent f26a4e2 commit 7efb01d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
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

0 commit comments

Comments
 (0)