Skip to content

Commit 34248c0

Browse files
author
kan
committed
Add check for boost version to set appropriate c++ standard.
1 parent 2763f04 commit 34248c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmake/SetCXXStandard.cmake

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

2+
find_package(Boost 1.56.0 REQUIRED)
3+
if(Boost_VERSION VERSION_LESS "1.72.0")
4+
set(CMAKE_CXX_STANDARD 11 CACHE INTERNAL "specifies the C++ standard whose features are requested to build this target")
5+
else()
6+
set(CMAKE_CXX_STANDARD 14 CACHE INTERNAL "specifies the C++ standard whose features are requested to build this target")
7+
endif()
28

3-
set(CMAKE_CXX_STANDARD 11 CACHE INTERNAL "specifies the C++ standard whose features are requested to build this target")
49
set(CMAKE_CXX_STANDARD_REQUIRED ON)
510
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
611
### Even though CMAKE_CXX_STANDARD_REQUIRED is supported since CMake 3.1, it doesn't work for Emscripten em++ together with

0 commit comments

Comments
 (0)