mirror of
https://github.com/gulrak/filesystem.git
synced 2025-12-08 01:36:39 +08:00
Fix building with (mostly) default flags on Windows MinGW
It's already being done for Cygwin, presumably for the same reasons. Clang auto-applies `-mbig-obj` as needed it seems: https://reviews.llvm.org/D102419 Tests against `std::filesystem` remain broken, though, and building with MinGW still requires disabling them manually with `-DGHC_FILESYSTEM_BUILD_STD_TESTING=NO`: https://github.com/gulrak/filesystem/issues/189#issuecomment-2571334165
This commit is contained in:
parent
84fa1ac50a
commit
d7d5e314db
@ -40,7 +40,7 @@ if (CMAKE_COMPILER_IS_GNUCXX AND (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 8.0 O
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
|
||||
target_link_libraries(${targetName} network)
|
||||
endif()
|
||||
target_compile_options(${targetName} PRIVATE $<$<BOOL:${CYGWIN}>:-Wa,-mbig-obj>)
|
||||
target_compile_options(${targetName} PRIVATE $<$<OR:$<BOOL:${CYGWIN}>,$<BOOL:${MINGW}>>:-Wa,-mbig-obj>)
|
||||
target_compile_definitions(${targetName} PRIVATE USE_STD_FS)
|
||||
endif()
|
||||
|
||||
@ -69,7 +69,7 @@ macro(AddTestExecutableWithStdCpp cppStd)
|
||||
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Werror -Wno-error=deprecated-declarations>
|
||||
$<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Wno-psabi -Werror -Wno-error=deprecated-declarations>
|
||||
$<$<CXX_COMPILER_ID:MSVC>:/WX /wd4996>
|
||||
$<$<BOOL:${CYGWIN}>:-Wa,-mbig-obj>
|
||||
$<$<OR:$<BOOL:${CYGWIN}>,$<BOOL:${MINGW}>>:-Wa,-mbig-obj>
|
||||
$<$<BOOL:${GHC_COVERAGE}>:--coverage>)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
target_compile_definitions(filesystem_test_cpp${cppStd} PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
|
||||
@ -14,7 +14,7 @@ function(SetTestCompileOptions target_name)
|
||||
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Werror -Wno-deprecated-declarations>
|
||||
$<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Wno-psabi -Werror -Wno-deprecated-declarations>
|
||||
$<$<CXX_COMPILER_ID:MSVC>:/WX /wd4996>
|
||||
$<$<BOOL:${CYGWIN}>:-Wa,-mbig-obj>)
|
||||
$<$<OR:$<BOOL:${CYGWIN}>,$<BOOL:${MINGW}>>:-Wa,-mbig-obj>)
|
||||
endfunction()
|
||||
|
||||
if(GHC_COVERAGE)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user