summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2012-04-20 09:23:44 (GMT)
committerChristian Mollekopf <chrigi_1@fastmail.fm>2012-04-20 09:23:44 (GMT)
commit178cda6230647b9f585ee6aecbbf3f0198dbf229 (patch)
treec55d2046a184c3227057c70bd277354a7746f297
parent3e14c568397d7500a8e734458a88bbac9030ce57 (diff)
downloadlibkolabxml-178cda6230647b9f585ee6aecbbf3f0198dbf229.tar.gz
Fix compile with gcc 4.7.
-rw-r--r--CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e36c65..c9bc40d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,6 +97,16 @@ endif(SWIG)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
+execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
+ OUTPUT_VARIABLE GCC_VERSION)
+if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+ message(STATUS "Version >= 4.7")
+ # gcc 4.7 no longer performs unqualified lookups by default, see: http://gcc.gnu.org/gcc-4.7/porting_to.html.
+ # This workaround is added for xsd code, which fails otherwise to compile. -fpermissive turns the errors into warnings.
+ # It's only temporary, and should be removed once xsd is fixed.
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive" )
+endif()
+
# set( CMAKE_VERBOSE_MAKEFILE on )
set(CMAKE_BUILD_TYPE Debug)