cmake: Don't add -std=c++11 to CMAKE_C_FLAGS

Fixes a cmake detection problem when compiling with clang (3.7.0 in my
case). clang outputs the error "Invalid argument '-std=c++11' not allowed
with 'C/ObjC'", which causes lzma, Xext and other things to be
considered "not found".
This commit is contained in:
Jonathan Li 2015-09-21 09:45:52 +01:00
parent b0803a4bc6
commit 2c2c61920e
1 changed files with 2 additions and 2 deletions

View File

@ -231,7 +231,7 @@ endif()
#-------------------------------------------------------------------------------
# Set some default compiler flags
#-------------------------------------------------------------------------------
set(COMMON_FLAG "-pipe -std=c++11 -fvisibility=hidden -pthread -fno-builtin-strcmp -fno-builtin-memcmp")
set(COMMON_FLAG "-pipe -fvisibility=hidden -pthread -fno-builtin-strcmp -fno-builtin-memcmp")
if (DISABLE_SVU)
set(COMMON_FLAG "${COMMON_FLAG} -DDISABLE_SVU")
endif()
@ -282,7 +282,7 @@ endif()
# Note: -DGTK_DISABLE_DEPRECATED can be used to test a build without gtk deprecated feature. It could be useful to port to a newer API
set(DEFAULT_GCC_FLAG "${ARCH_FLAG} ${COMMON_FLAG} ${DEFAULT_WARNINGS} ${AGGRESSIVE_WARNING} ${HARDENING_FLAG} ${DEBUG_FLAG} ${ASAN_FLAG} ${OPTIMIZATION_FLAG}")
# c++ only flags
set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -Wno-invalid-offsetof")
set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -std=c++11 -Wno-invalid-offsetof")
#-------------------------------------------------------------------------------
# Allow user to set some default flags