Skip to content

Commit

Permalink
In CMakeList.txt, only use cxx_std_11 in target_compile_features when…
Browse files Browse the repository at this point in the history
… the CMake version is >= 3.8 (#37).
  • Loading branch information
Tessil committed Jul 25, 2018
1 parent bc61fd4 commit 9567cb8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ add_library(tsl_hopscotch_map INTERFACE)
add_library(tsl::hopscotch_map ALIAS tsl_hopscotch_map)

target_include_directories(tsl_hopscotch_map INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_compile_features(tsl_hopscotch_map INTERFACE cxx_std_11)
target_sources(tsl_hopscotch_map INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/bhopscotch_map.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/bhopscotch_set.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/hopscotch_growth_policy.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/hopscotch_hash.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/hopscotch_map.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/hopscotch_set.h")


if(${CMAKE_VERSION} VERSION_GREATER "3.7")
# Only available since version 3.8
target_compile_features(tsl_hopscotch_map INTERFACE cxx_std_11)
endif()

0 comments on commit 9567cb8

Please sign in to comment.