Fix tests CMakeLists.txt on MinGW

This commit is contained in:
Oz 2023-09-16 19:45:12 +02:00
parent 9fd43f3828
commit 30fe67624e
No known key found for this signature in database
GPG Key ID: 3B09C10F3DB6E52A
2 changed files with 14 additions and 2 deletions

View File

@ -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()

View File

@ -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)