mirror of
https://github.com/gulrak/filesystem.git
synced 2025-12-06 16:56:40 +08:00
Fix tests CMakeLists.txt on MinGW
This commit is contained in:
parent
9fd43f3828
commit
30fe67624e
@ -74,6 +74,9 @@ macro(AddTestExecutableWithStdCpp cppStd)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
target_compile_definitions(filesystem_test_cpp${cppStd} PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
if(MINGW)
|
||||
target_compile_options(filesystem_test_cpp${cppStd} PUBLIC "-Wa,-mbig-obj")
|
||||
endif()
|
||||
if(EMSCRIPTEN)
|
||||
set_target_properties(filesystem_test_cpp${cppStd} PROPERTIES LINK_FLAGS "-g4 -s DISABLE_EXCEPTION_CATCHING=0 -s ALLOW_MEMORY_GROWTH=1")
|
||||
endif()
|
||||
|
||||
@ -38,6 +38,9 @@ else()
|
||||
message("Generating test runner for normal test...")
|
||||
add_executable(filesystem_test filesystem_test.cpp catch.hpp)
|
||||
target_link_libraries(filesystem_test ghc_filesystem)
|
||||
if(MINGW)
|
||||
target_compile_options(filesystem_test PUBLIC "-Wa,-mbig-obj")
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "(SunOS|Solaris)")
|
||||
target_link_libraries(filesystem_test xnet)
|
||||
endif()
|
||||
@ -59,6 +62,9 @@ else()
|
||||
add_executable(filesystem_test_char filesystem_test.cpp catch.hpp)
|
||||
target_link_libraries(filesystem_test_char ghc_filesystem)
|
||||
SetTestCompileOptions(filesystem_test_char)
|
||||
if(MINGW)
|
||||
target_compile_options(filesystem_test_char PUBLIC "-Wa,-mbig-obj")
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
target_compile_definitions(filesystem_test_char PRIVATE _CRT_SECURE_NO_WARNINGS GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE)
|
||||
else()
|
||||
@ -90,6 +96,9 @@ SetTestCompileOptions(fwd_impl_test)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
target_compile_definitions(fwd_impl_test PRIVATE _CRT_SECURE_NO_WARNINGS WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
endif()
|
||||
if(MINGW)
|
||||
target_compile_options(fwd_impl_test PUBLIC "-Wa,-mbig-obj")
|
||||
endif()
|
||||
add_test(fwd_impl_test fwd_impl_test)
|
||||
|
||||
add_executable(exception exception.cpp)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user