From 2cca5662f46b4ff89fa0b8488251e0766d0f2245 Mon Sep 17 00:00:00 2001 From: Attila Mark Date: Sun, 7 Jun 2020 19:22:49 -0700 Subject: [PATCH] MINGW cross compiler fixes --- CMakeLists.txt | 8 +++++--- test/CMakeLists.txt | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca4114c5..9f555d89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,9 +105,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") -Winvalid-pch -Woverloaded-virtual -Wconversion -Wswitch-enum -Wno-ctor-dtor-privacy -Wno-format-nonliteral -Wno-shadow) - if (MINGW) - target_compile_options("-Wa,-mbig-obj") - endif () if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wnoexcept -Wno-dangling-else -Wno-unused-local-typedefs) @@ -194,6 +191,11 @@ if (HAVE_STRTOD_L) target_compile_definitions(fmt PUBLIC FMT_LOCALE) endif () +if (MINGW) + target_compile_options(fmt PRIVATE "-Wa,-mbig-obj") +# target_compile_options(fmt PRIVATE "-g") +endif () + if (FMT_WERROR) target_compile_options(fmt PRIVATE ${WERROR_FLAG}) endif () diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 89176633..f7734460 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -66,6 +66,7 @@ endif () function(add_fmt_executable name) add_executable(${name} ${ARGN}) if (MINGW) + target_compile_options(${name} PRIVATE "-Wa,-mbig-obj") target_link_libraries(${name} -static-libgcc -static-libstdc++) endif () endfunction()