From d7d5e314dbf728217a877b426480552b585e2961 Mon Sep 17 00:00:00 2001 From: 500-internal-server-error <76838083+500-internal-server-error@users.noreply.github.com> Date: Wed, 19 Feb 2025 20:24:57 +0700 Subject: [PATCH] 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 --- cmake/GhcHelper.cmake | 4 ++-- test/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/GhcHelper.cmake b/cmake/GhcHelper.cmake index 4d9e5a0..ad72fd2 100644 --- a/cmake/GhcHelper.cmake +++ b/cmake/GhcHelper.cmake @@ -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 $<$:-Wa,-mbig-obj>) + target_compile_options(${targetName} PRIVATE $<$,$>:-Wa,-mbig-obj>) target_compile_definitions(${targetName} PRIVATE USE_STD_FS) endif() @@ -69,7 +69,7 @@ macro(AddTestExecutableWithStdCpp cppStd) $<$,$>:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Werror -Wno-error=deprecated-declarations> $<$:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Wno-psabi -Werror -Wno-error=deprecated-declarations> $<$:/WX /wd4996> - $<$:-Wa,-mbig-obj> + $<$,$>:-Wa,-mbig-obj> $<$:--coverage>) if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) target_compile_definitions(filesystem_test_cpp${cppStd} PRIVATE _CRT_SECURE_NO_WARNINGS) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1401ef0..5a529a2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -14,7 +14,7 @@ function(SetTestCompileOptions target_name) $<$,$>:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Werror -Wno-deprecated-declarations> $<$:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Wno-psabi -Werror -Wno-deprecated-declarations> $<$:/WX /wd4996> - $<$:-Wa,-mbig-obj>) + $<$,$>:-Wa,-mbig-obj>) endfunction() if(GHC_COVERAGE)