Skip to content

Commit

Permalink
Compiler/library feature detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mzdun committed Sep 15, 2020
1 parent d32a0a6 commit e8ec87a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,26 @@ add_library(args STATIC
"${CMAKE_CURRENT_BINARY_DIR}/include/args/version.hpp"
)
target_compile_options(args PRIVATE ${ADDITIONAL_WALL_FLAGS})
target_compile_features(args PRIVATE cxx_std_17)
target_include_directories(args
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/include
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)

include(CheckCXXSourceCompiles)
function(check_charconv)
check_cxx_source_compiles("#include <charconv>
int main() {}" HAS_CHARCONV_)
set(HAS_CHARCONV ${HAS_CHARCONV_} PARENT)
endfunction()
check_cxx_source_compiles("#include <charconv>
int main() {}" HAS_CHARCONV)

if (NOT HAS_CHARCONV)
message(FATAL_ERROR "The compiler has no access to <charconv>")
endif()

##################################################################
## INSTALL
##################################################################
Expand Down

0 comments on commit e8ec87a

Please sign in to comment.