Skip to content

Instantly share code, notes, and snippets.

@manuelm
Created February 23, 2015 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manuelm/f71c1d33a57e5bcca758 to your computer and use it in GitHub Desktop.
Save manuelm/f71c1d33a57e5bcca758 to your computer and use it in GitHub Desktop.
diff --git a/project/cmake/kodi-config.cmake.in b/project/cmake/kodi-config.cmake.in
index 0e3b158..5dcf42c 100644
--- a/project/cmake/kodi-config.cmake.in
+++ b/project/cmake/kodi-config.cmake.in
@@ -3,7 +3,7 @@ SET(APP_NAME @APP_NAME@)
SET(APP_VERSION_MAJOR @APP_VERSION_MAJOR@)
SET(APP_VERSION_MINOR @APP_VERSION_MINOR@)
IF(NOT WIN32)
- SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@")
+ SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS} @CXX11_SWITCH@")
ENDIF()
LIST(APPEND CMAKE_MODULE_PATH @prefix@/lib/kodi)
ADD_DEFINITIONS(@ARCH_DEFINES@)
diff --git a/project/cmake/scripts/common/handle-depends.cmake b/project/cmake/scripts/common/handle-depends.cmake
index f0ae25f..eb0aae7 100644
--- a/project/cmake/scripts/common/handle-depends.cmake
+++ b/project/cmake/scripts/common/handle-depends.cmake
@@ -63,8 +63,11 @@ function(add_addon_depends addon searchpath)
# TODO: figure out if we should use -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} ${ARCH_DEFINES}" and why it doesn't work
# TODO: figure out why this doesn't work for OSX32 and IOS/ATV2
if(NOT CMAKE_USER_MAKE_RULES_OVERRIDE AND NOT CMAKE_USER_MAKE_RULES_OVERRIDE_CXX AND NOT APPLE)
- list(APPEND BUILD_ARGS -DCMAKE_C_FLAGS=${ARCH_DEFINES}
- -DCMAKE_CXX_FLAGS=${ARCH_DEFINES})
+ # make sure we create strings, not lists
+ set(TMP_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_DEFINES}")
+ set(TMP_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_DEFINES}")
+ list(APPEND BUILD_ARGS -DCMAKE_C_FLAGS=${TMP_C_FLAGS}
+ -DCMAKE_CXX_FLAGS=${TMP_CXX_FLAGS})
endif()
if(CMAKE_TOOLCHAIN_FILE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment