Skip to content

Commit ef6e5db

Browse files
authored
Export cxx-standard with target. (#604)
1 parent 25b25c7 commit ef6e5db

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CONFIG_PATH}")
77

88
set(BTCPP_LIBRARY ${PROJECT_NAME})
99

10-
#---- Enable C++17 ----
11-
set(CMAKE_CXX_STANDARD 17)
12-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
13-
1410
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
1511
message(STATUS "Setting build type to 'Release' as none was specified.")
1612
set(CMAKE_BUILD_TYPE "Release" CACHE
@@ -179,6 +175,8 @@ target_include_directories(${BTCPP_LIBRARY}
179175
target_compile_definitions(${BTCPP_LIBRARY} PRIVATE $<$<CONFIG:Debug>:TINYXML2_DEBUG>)
180176
target_compile_definitions(${BTCPP_LIBRARY} PUBLIC BTCPP_LIBRARY_VERSION="${CMAKE_PROJECT_VERSION}")
181177

178+
target_compile_features(${BTCPP_LIBRARY} PUBLIC cxx_std_17)
179+
182180
if(MSVC)
183181
else()
184182
target_compile_options(${BTCPP_LIBRARY} PRIVATE -Wall -Wextra)

0 commit comments

Comments
 (0)