Skip to content

Commit 55f11db

Browse files
committed
issue #9269 Not able to compile with MSYS2/mingw (file too big)
Adding compilation flags for MSYS2/MinGW environment analogous to Cygwin environment. (As it is a different environment an extra block)
1 parent 9258d25 commit 55f11db

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,20 @@ if (CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
9696
endif()
9797
endif()
9898

99+
if (CMAKE_SYSTEM_NAME MATCHES "WINDOWS")
100+
if ((CMAKE_GENERATOR MATCHES "MinGW Makefiles") OR
101+
(CMAKE_GENERATOR MATCHES "MSYS Makefiles") OR
102+
(CMAKE_GENERATOR MATCHES "Unix Makefiles"))
103+
104+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
105+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og")
106+
107+
if (CMAKE_BUILD_TYPE STREQUAL "")
108+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1")
109+
endif()
110+
endif()
111+
endif()
112+
99113
if(POLICY CMP0063)
100114
cmake_policy(SET CMP0063 NEW)
101115
endif()

0 commit comments

Comments
 (0)