Skip to content

Commit

Permalink
Avoid cmake expression-generator
Browse files Browse the repository at this point in the history
Signed-off-by: Uilian Ries <[email protected]>
  • Loading branch information
uilianries committed Jun 29, 2024
1 parent 84ac09b commit 8a3eebe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ project(faker-cxx LANGUAGES CXX)

include(cmake/CompilerWarnings.cmake)

set(CMAKE_REQUIRED_FLAGS "$<$<CXX_COMPILER_ID:MSVC>:/std:c++20>$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-std=c++20>")
if (MSVC)
set(CMAKE_REQUIRED_FLAGS /std:c++20)
else()
set(CMAKE_REQUIRED_FLAGS -std=c++20)
endif()
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("#include <format>\nint main(){ auto var = std::format(\"{}\", \"Hello\"); return 0; }"
HAS_STD_FORMAT)
Expand Down

0 comments on commit 8a3eebe

Please sign in to comment.