Skip to content

Commit

Permalink
Use check_cxx_source_compiles to validate std::format
Browse files Browse the repository at this point in the history
Signed-off-by: Uilian Ries <[email protected]>
  • Loading branch information
uilianries committed May 23, 2024
1 parent 5bb9ca8 commit 057510c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ project(${PROJECT_NAME} CXX)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

include(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX("format" HAS_STD_FORMAT)
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_FLAGS -std=c++20)
check_cxx_source_compiles("#include <format>\nint main(){ auto var = std::format(\"{}\", \"Hello\"); return 0; }" HAS_STD_FORMAT)

option(BUILD_FAKER_TESTS DEFAULT ON)

Expand Down

0 comments on commit 057510c

Please sign in to comment.