Split clang

This commit is contained in:
Michael Callahan 2014-12-30 11:51:23 -07:00
parent 35a07fef3e
commit 50347ca95b

View file

@ -74,14 +74,30 @@ IF(MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "/Ox") set(CMAKE_CXX_FLAGS_RELEASE "/Ox")
# Generate complete debugging information # Generate complete debugging information
#set(CMAKE_CXX_FLAGS_DEBUG "/Zi") #set(CMAKE_CXX_FLAGS_DEBUG "/Zi")
ELSEIF (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) ELSEIF (CMAKE_COMPILER_IS_GNUCXX)
# linux/gcc, bsd/gcc, windows/mingw, osx/llvm, bsd/llvm # linux/gcc, bsd/gcc, windows/mingw
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
set(CMAKE_CXX_FLAGS_RELEASE "-s -std=c++98 -pedantic -O3") set(CMAKE_CXX_FLAGS_RELEASE "-s -std=c++98 -pedantic -O3")
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wextra -std=c++98 -pedantic -Werror") set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wextra -std=c++98 -pedantic -Werror")
set(ADDITIONAL_DEBUG_FLAGS -Wcast-align -Wmissing-declarations -Wno-long-long -Wno-error=extra -Wno-error=sign-compare -Wno-error=missing-declarations -Wno-c++11-long-long) set(ADDITIONAL_DEBUG_FLAGS -Wcast-align -Wmissing-declarations -Wno-long-long -Wno-error=extra -Wno-error=sign-compare -Wno-error=missing-declarations)
FOREACH(FLAG ${ADDITIONAL_DEBUG_FLAGS})
CHECK_CXX_COMPILER_FLAG("${FLAG}" CXX_HAS_WARNING_${FLAG})
IF(CXX_HAS_WARNING_${FLAG})
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
ENDIF()
ENDFOREACH()
ELSEIF (CMAKE_COMPILER_IS_CLANGXX)
# osx/llvm, bsd/llvm
# linux/gcc, bsd/gcc, windows/mingw
include(CheckCXXCompilerFlag)
set(CMAKE_CXX_FLAGS_RELEASE "-s -std=c++11 -pedantic -O3")
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wextra -std=c++11 -pedantic -Werror")
set(ADDITIONAL_DEBUG_FLAGS -Wcast-align -Wmissing-declarations -Wno-long-long -Wno-error=extra -Wno-error=sign-compare -Wno-error=missing-declarations)
FOREACH(FLAG ${ADDITIONAL_DEBUG_FLAGS}) FOREACH(FLAG ${ADDITIONAL_DEBUG_FLAGS})
CHECK_CXX_COMPILER_FLAG("${FLAG}" CXX_HAS_WARNING_${FLAG}) CHECK_CXX_COMPILER_FLAG("${FLAG}" CXX_HAS_WARNING_${FLAG})