Skip to content

Instantly share code, notes, and snippets.

@manuelm
Created February 23, 2015 16:37
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/add01d82f63bb82553e4 to your computer and use it in GitHub Desktop.
Save manuelm/add01d82f63bb82553e4 to your computer and use it in GitHub Desktop.
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)
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/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt
index d755fd4..0993a10 100644
--- a/project/cmake/addons/CMakeLists.txt
+++ b/project/cmake/addons/CMakeLists.txt
@@ -69,7 +69,9 @@ set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
-DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE}
-DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX}
-DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME}
- -DBUILD_SHARED_LIBS=1)
+ -DBUILD_SHARED_LIBS=1
+ -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
+ -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS})
if(PACKAGE_ZIP)
# needed for project installing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment