[cmake] Prevented function inlining for C++ samples on mingw (see mingw bug <http://sourceforge.net/p/mingw/bugs/2250/>)

This commit is contained in:
Snaipe 2016-01-19 22:47:57 +01:00
parent 56364bd811
commit 8b11c2d179
2 changed files with 10 additions and 0 deletions

View file

@ -1,6 +1,11 @@
if (NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_DEFAULT} -std=c99 -Wall -Wextra -pedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEFAULT} ${CXX11_FLAG} -Wall -Wextra -pedantic")
if (MINGW)
# see http://sourceforge.net/p/mingw/bugs/2250/
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__NO_INLINE__")
endif ()
endif ()
include_directories(../include)

View file

@ -2,6 +2,11 @@ if (NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_DEFAULT} -std=gnu99 -Wall -Wextra")
if (CMAKE_CXX_COMPILER_WORKS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEFAULT} ${CXX11_FLAG} -Wall -Wextra")
if (MINGW)
# see http://sourceforge.net/p/mingw/bugs/2250/
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__NO_INLINE__")
endif ()
endif ()
endif ()