# HG changeset patch # User Santeri Piippo # Date 1397127401 -10800 # Node ID bc589e352f5beaed01d05a8ccfe2aea29d846cd6 # Parent 06c4477675e456d7c5cbd28592b2b6a3f3bc770d - now compiles with clang diff -r 06c4477675e4 -r bc589e352f5b CMakeLists.txt --- a/CMakeLists.txt Tue Apr 08 11:11:32 2014 +0300 +++ b/CMakeLists.txt Thu Apr 10 13:56:41 2014 +0300 @@ -104,6 +104,15 @@ set (LDForgeResources ldforge.qrc) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lGLU") + +# With clang, we need to set -Wno-deprecated since Qt headers seem to use the +# register keyword which clang doesn't seem to like. It also appears that Qt +# doesn't set Q_COMPILER_INITIALIZER_LISTS when compiling with clang? What's +# up with that? +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -DQ_COMPILER_INITIALIZER_LISTS") +endif() + include_directories ("${PROJECT_BINARY_DIR}") include_directories ("${PROJECT_BINARY_DIR}/src") include_directories ("${PROJECT_BINARY_DIR}/src/misc")