Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

-fno-keep-inline-dllexport only exists in gcc >= 4.6.1

  • Loading branch information...
commit ccaa2ecf3682571f8939f604bb5efb0ca3323d31 1 parent d6a92c3
@davidm davidm authored
Showing with 9 additions and 2 deletions.
  1. +6 −2 CMakeLists.txt
  2. +3 −0  cmake/configure.cmake
View
8 CMakeLists.txt
@@ -13,8 +13,12 @@ include ( configure )
# 2DO: Use file globs where apropriate to reduce the ridiculous filelists
# NOTE: We do not follow the recommended wxwidgets naming conventions as it conflicts with our conventions
-# Avoid linking memory issue with gcc (see wxwidgets wiki for details)
-set ( CMAKE_CXX_FLAGS "-fno-keep-inline-dllexport" )
+# Avoid leaking memory issue with gcc/mingw.
+# http://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW
+# http://old.nabble.com/MinGW-GCC-4.6.1-released-p32468533.html
+if (HAVE_FNO_KEEP_INLINE_DLLEXPORT)
+ set ( CMAKE_CXX_FLAGS "-fno-keep-inline-dllexport" )
+endif ()
configure_file ( include/wx/msw/setup.h ${CMAKE_CURRENT_BINARY_DIR}/include/wx/setup.h )
configure_file ( include/wx/msw/genrcdefs.h ${CMAKE_CURRENT_BINARY_DIR}/include/wx/msw/rcdefs.h )
View
3  cmake/configure.cmake
@@ -1,4 +1,5 @@
include ( TestBigEndian )
+include ( CheckCCompilerFlag )
test_big_endian ( BIGENDIAN )
if ( BIGENDIAN )
@@ -30,3 +31,5 @@ if ( NOT HAVE_SYS_TYPES_H )
set ( OFF_T long )
set ( SIZE_T ungigned )
endif ()
+
+check_c_compiler_flag(-fno-keep-inline-dllexport HAVE_FNO_KEEP_INLINE_DLLEXPORT) # gcc >= 4.6.1
Please sign in to comment.
Something went wrong with that request. Please try again.