mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-27 08:31:03 +08:00
Use the highest possible C++ standard (#18)
This commit is contained in:
parent
0af7654764
commit
44c2515280
@ -52,7 +52,14 @@ if( BUILD_STATIC )
|
||||
else( )
|
||||
add_library( tz SHARED ${HEADER_FILES} ${SOURCE_FOLDER}/tz.cpp )
|
||||
endif( )
|
||||
set_property(TARGET tz PROPERTY CXX_STANDARD 14)
|
||||
|
||||
if ( ${CMAKE_MINOR_VERSION} GREATER 7 )
|
||||
set( TZ_CXX_STANDARD 17 )
|
||||
else( )
|
||||
set( TZ_CXX_STANDARD 14 )
|
||||
endif( )
|
||||
|
||||
set_property(TARGET tz PROPERTY CXX_STANDARD ${TZ_CXX_STANDARD})
|
||||
target_link_libraries( tz ${CMAKE_THREAD_LIBS_INIT} ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
|
||||
|
||||
# add include folders to the library and targets that consume it
|
||||
@ -83,7 +90,7 @@ function( add_pass_tests TEST_GLOB TEST_PREFIX )
|
||||
set( BIN_NAME ${PREFIX}_bin )
|
||||
set( TST_NAME ${PREFIX}_test )
|
||||
add_executable( ${BIN_NAME} EXCLUDE_FROM_ALL ${TEST_FILE} )
|
||||
set_property(TARGET ${BIN_NAME} PROPERTY CXX_STANDARD 14)
|
||||
set_property(TARGET ${BIN_NAME} PROPERTY CXX_STANDARD ${TZ_CXX_STANDARD})
|
||||
add_test( ${TST_NAME} ${BIN_NAME} )
|
||||
target_link_libraries( ${BIN_NAME} tz )
|
||||
add_dependencies( testit ${BIN_NAME} )
|
||||
|
Loading…
x
Reference in New Issue
Block a user