From e06790cbee9f0f40ce93f2e3b45ecaba3b0933ab Mon Sep 17 00:00:00 2001 From: Marc Date: Sun, 11 Oct 2020 15:21:25 +0200 Subject: [PATCH] Added check whether mingw has -mbig-obj flag --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1341e9f3..3fac2afc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,10 @@ if (HAVE_STRTOD_L) endif () if (MINGW) - target_compile_options(fmt PUBLIC "-Wa,-mbig-obj") + check_cxx_compiler_flag("Wa,-mbig-obj" FMT_HAS_MBIG_OBJ) + if (${FMT_HAS_MBIG_OBJ}) + target_compile_options(fmt PUBLIC "-Wa,-mbig-obj") + endif() endif () if (FMT_WERROR)