aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2024-06-02 17:38:47 +1000
committerfuzzard <fuzzard@kodi.tv>2024-06-17 12:47:41 +1000
commit214cb38c6686b480b8ddd710ce5ed78016782223 (patch)
tree7c127de95e3fbc63bee6e5cf8c8674a0c7dd3946 /CMakeLists.txt
parent6f766bb4d6cd4cf165ff80b17ec030e88fc7b4b9 (diff)
[cmake] Remove NATIVEPREFIX from search paths for build target searches
We dont want our build target find searches to search in nativeprefix. This can inadvertently use config packages that are available in both native and target prefixes from the wrong location.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa674c7c4f..6c52b76a40 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -199,6 +199,11 @@ set(optional_buildtools CCache
core_optional_dep(${optional_buildtools})
core_require_dep(${required_buildtools})
+# We want to explicitly ignore NATIVEPREFIX for any find calls to build target dependencies
+if(NATIVEPREFIX)
+ set(CMAKE_IGNORE_PREFIX_PATH ${NATIVEPREFIX})
+endif()
+
# Required dependencies. Keep in alphabetical order please
set(required_deps ASS>=0.15.0
Cdio
@@ -290,6 +295,13 @@ if(ENABLE_AIRTUNES)
endif()
endif()
+# We unset this after the bulk of our find calls are complete. Ideally we would want this enabled
+# for anything that is build target related, and only remove for native buildtools, however
+# thats more complicated for the need right now.
+if(NATIVEPREFIX)
+ unset(CMAKE_IGNORE_PREFIX_PATH)
+endif()
+
# find all folders containing addon.xml.in
# used to define ADDON_XML_OUTPUTS, ADDON_XML_DEPENDS and ADDON_INSTALL_DATA
# Function defined in ./cmake/scripts/common/Macros.cmake