Skip to content

Commit

Permalink
Pass msvc flags
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 c3a1675 commit b32bab9
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 @@ -11,7 +11,7 @@ option(USE_SYSTEM_DEPENDENCIES "Use fmt and GTest from system" OFF)
if (NOT USE_SYSTEM_DEPENDENCIES)
set(CMAKE_REQUIRED_FLAGS -std=c++20)
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("#include <format>\nint main(){ return 0; }"
check_cxx_source_compiles("#include <format>\nint main(){ auto var = std::format(\"{}\", \"Hello\"); return 0; }"
HAS_STD_FORMAT)
endif()

Expand Down Expand Up @@ -153,6 +153,10 @@ if (BUILD_FAKER_TESTS)
add_code_coverage_all_targets()

add_executable(${LIBRARY_NAME}-UT ${FAKER_UT_SOURCES})
if (MSVC)
target_compile_options(${LIBRARY_NAME}-UT PRIVATE /permissive- /bigobj)
endif()

if (USE_SYSTEM_DEPENDENCIES)
find_package(GTest REQUIRED)
target_link_libraries(${LIBRARY_NAME}-UT PRIVATE GTest::gtest
Expand Down

0 comments on commit b32bab9

Please sign in to comment.