From ad2229a7819db21475f4b41e5e9ba3feb12566f9 Mon Sep 17 00:00:00 2001 From: slipher Date: Fri, 10 Oct 2025 07:29:38 -0500 Subject: [PATCH 1/2] Remove some useless CMAKE_FIND_ROOT_PATH_MODE_xxx vars These variables in the mingw cross toolchain files no longer mean anything since the line that sets CMAKE_FIND_ROOT_PATH was removed in 14a9eb7550f50e785ff51c2afaf48f6c3366cb3f. --- cmake/cross-toolchain-mingw32.cmake | 6 ------ cmake/cross-toolchain-mingw64.cmake | 6 ------ 2 files changed, 12 deletions(-) diff --git a/cmake/cross-toolchain-mingw32.cmake b/cmake/cross-toolchain-mingw32.cmake index c33340276b..1eafe84f2f 100644 --- a/cmake/cross-toolchain-mingw32.cmake +++ b/cmake/cross-toolchain-mingw32.cmake @@ -6,9 +6,3 @@ set( CMAKE_SYSTEM_PROCESSOR x86 ) set( CMAKE_C_COMPILER i686-w64-mingw32-gcc ) set( CMAKE_CXX_COMPILER i686-w64-mingw32-g++ ) set( CMAKE_RC_COMPILER i686-w64-mingw32-windres ) - -# Find programs using host paths and headers/libraries using target paths -# FIXME: not respected when cmake invokes pkg-config -set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) -set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) -set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) diff --git a/cmake/cross-toolchain-mingw64.cmake b/cmake/cross-toolchain-mingw64.cmake index 24636132bf..0ab09c6c5b 100644 --- a/cmake/cross-toolchain-mingw64.cmake +++ b/cmake/cross-toolchain-mingw64.cmake @@ -6,9 +6,3 @@ set( CMAKE_SYSTEM_PROCESSOR x86_64 ) set( CMAKE_C_COMPILER x86_64-w64-mingw32-gcc ) set( CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++ ) set( CMAKE_RC_COMPILER x86_64-w64-mingw32-windres ) - -# Find programs using host paths and headers/libraries using target paths -# FIXME: not respected when cmake invokes pkg-config -set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) -set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) -set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) From 94be4955d45bdecfa7e2169ab9a09f55ebba47b0 Mon Sep 17 00:00:00 2001 From: slipher Date: Fri, 10 Oct 2025 07:54:07 -0500 Subject: [PATCH 2/2] Don't set CMAKE_PREFIX_PATH to external deps dir We were adding the external deps location to both CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH. Only one is needed. CMAKE_PREFIX_PATH has the weird behavior that if CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH are both set, each (root path) X (prefix path) pair is considered, and when one isn't a subpath of the other, the search directory that results is formed by concatenating the root path and the prefix path. The deps dir is always an absolute path and not something that we want to be concatenated in the middle, so avoid using CMAKE_PREFIX_PATH. This should make it possible to use CMAKE_FIND_ROOT_PATH in a toolchain file without getting issues from the concatenation behavior, if it turn out to be truly necessary for some toolchain. --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62bd46f1a0..8cbb12b6a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -558,13 +558,11 @@ if (DEPS_DIR) set(CMAKE_FIND_ROOT_PATH ${DEPS_DIR} ${CMAKE_FIND_ROOT_PATH}) set(CMAKE_INCLUDE_PATH ${DEPS_DIR} ${DEPS_DIR}/include ${CMAKE_INCLUDE_PATH}) set(CMAKE_FRAMEWORK_PATH ${DEPS_DIR}/lib ${CMAKE_FRAMEWORK_PATH}) - set(CMAKE_PREFIX_PATH ${DEPS_DIR} ${CMAKE_PREFIX_PATH}) if (DAEMON_PARENT_SCOPE_DIR) # Also set parent scope so the top level CMakeLists can find precompiled deps set(CMAKE_FIND_ROOT_PATH ${DEPS_DIR} ${CMAKE_FIND_ROOT_PATH} PARENT_SCOPE) set(CMAKE_INCLUDE_PATH ${DEPS_DIR} ${DEPS_DIR}/include ${CMAKE_INCLUDE_PATH} PARENT_SCOPE) set(CMAKE_FRAMEWORK_PATH ${DEPS_DIR} ${CMAKE_FRAMEWORK_PATH} PARENT_SCOPE) - set(CMAKE_PREFIX_PATH ${DEPS_DIR} ${CMAKE_PREFIX_PATH} PARENT_SCOPE) endif() endif() endif()