Skip to content

Commit

Permalink
issue #9269 Not able to compile with MSYS2/mingw (file too big)
Browse files Browse the repository at this point in the history
Adding compilation flags for MSYS2/MinGW environment analogous to Cygwin environment.
(As it is a different environment an extra block)
  • Loading branch information
albert-github committed Apr 12, 2022
1 parent 9258d25 commit 55f11db
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Expand Up @@ -96,6 +96,20 @@ if (CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
endif()
endif()

if (CMAKE_SYSTEM_NAME MATCHES "WINDOWS")
if ((CMAKE_GENERATOR MATCHES "MinGW Makefiles") OR
(CMAKE_GENERATOR MATCHES "MSYS Makefiles") OR
(CMAKE_GENERATOR MATCHES "Unix Makefiles"))

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og")

if (CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1")
endif()
endif()
endif()

if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
Expand Down

0 comments on commit 55f11db

Please sign in to comment.