aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-10-27 06:43:31 -0700
committerChris Robinson <[email protected]>2018-10-29 10:10:37 -0700
commitf1058c635f629cb8e2adb791a3cf3bba7fe7c248 (patch)
tree910b9370f879a6e21d3c37e068bd903bb7a0b99d
parent7f8ef092aac523cf52c77e069cb6091370ab0a7a (diff)
Handle C++-only compile flags in cmake
-rw-r--r--CMakeLists.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 39b80250..c05bcb10 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,6 +65,7 @@ endif()
SET(CPP_DEFS ) # C pre-process, not C++
SET(INC_PATHS )
SET(C_FLAGS )
+SET(CXX_FLAGS )
SET(LINKER_FLAGS )
SET(EXTRA_LIBS )
@@ -1382,7 +1383,7 @@ CONFIGURE_FILE(
# Add a static library with common functions used by multiple targets
ADD_LIBRARY(common STATIC ${COMMON_OBJS})
TARGET_COMPILE_DEFINITIONS(common PRIVATE ${CPP_DEFS})
-TARGET_COMPILE_OPTIONS(common PRIVATE ${C_FLAGS})
+TARGET_COMPILE_OPTIONS(common PRIVATE ${C_FLAGS} $<$<COMPILE_LANGUAGE:CXX>:${CXX_FLAGS}>)
UNSET(HAS_ROUTER)
@@ -1415,7 +1416,7 @@ ELSE()
ADD_LIBRARY(OpenAL SHARED router/router.c router/router.h router/alc.c router/al.c)
TARGET_COMPILE_DEFINITIONS(OpenAL
PRIVATE AL_BUILD_LIBRARY AL_ALEXT_PROTOTYPES ${CPP_DEFS})
- TARGET_COMPILE_OPTIONS(OpenAL PRIVATE ${C_FLAGS})
+ TARGET_COMPILE_OPTIONS(OpenAL PRIVATE ${C_FLAGS} $<$<COMPILE_LANGUAGE:CXX>:${CXX_FLAGS}>)
TARGET_LINK_LIBRARIES(OpenAL PRIVATE ${LINKER_FLAGS} ${COMMON_LIB})
SET_TARGET_PROPERTIES(OpenAL PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(OpenAL PROPERTIES OUTPUT_NAME ${LIBNAME})
@@ -1441,7 +1442,7 @@ TARGET_COMPILE_DEFINITIONS(${IMPL_TARGET}
PRIVATE AL_BUILD_LIBRARY AL_ALEXT_PROTOTYPES ${CPP_DEFS})
TARGET_INCLUDE_DIRECTORIES(${IMPL_TARGET}
PRIVATE "${OpenAL_SOURCE_DIR}/OpenAL32/Include" "${OpenAL_SOURCE_DIR}/Alc" ${INC_PATHS})
-TARGET_COMPILE_OPTIONS(${IMPL_TARGET} PRIVATE ${C_FLAGS})
+TARGET_COMPILE_OPTIONS(${IMPL_TARGET} PRIVATE ${C_FLAGS} $<$<COMPILE_LANGUAGE:CXX>:${CXX_FLAGS}>)
TARGET_LINK_LIBRARIES(${IMPL_TARGET}
PRIVATE ${LINKER_FLAGS} ${COMMON_LIB} ${EXTRA_LIBS} ${MATH_LIB})
IF(TARGET build_version)