Skip to content

Commit 7f48ac7

Browse files
slipherillwieckz
authored andcommitted
cmake: don't set CMAKE_FIND_ROOT_PATH in toolchain files
When CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH are both set, cmake concatenates them together, instead of using CMAKE_PREFIX_PATH as a full path like we want. Turns out CMAKE_FIND_ROOT_PATH didn't do anything anyway, so get rid of that.
1 parent 3efd3e6 commit 7f48ac7

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

cmake/cross-toolchain-mingw32.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ set( CMAKE_C_COMPILER i686-w64-mingw32-gcc )
77
set( CMAKE_CXX_COMPILER i686-w64-mingw32-g++ )
88
set( CMAKE_RC_COMPILER i686-w64-mingw32-windres )
99

10-
# Target prefix
11-
set( CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32;${CMAKE_PREFIX_PATH} )
12-
1310
# Find programs using host paths and headers/libraries using target paths
11+
# FIXME: not respected when cmake invokes pkg-config
1412
set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
1513
set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
1614
set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )

cmake/cross-toolchain-mingw64.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ set( CMAKE_C_COMPILER x86_64-w64-mingw32-gcc )
77
set( CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++ )
88
set( CMAKE_RC_COMPILER x86_64-w64-mingw32-windres )
99

10-
# Target prefix
11-
set( CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32;${CMAKE_PREFIX_PATH} )
12-
1310
# Find programs using host paths and headers/libraries using target paths
11+
# FIXME: not respected when cmake invokes pkg-config
1412
set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
1513
set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
1614
set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )

external_deps/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ cmake_build() {
243243
cmake --install build --strip
244244
}
245245

246-
# Build pkg-config
247-
# Still needed, at least on macos, for opusfile
246+
# Build pkg-config, needed for opusfile
247+
# As a host-mode dependency it must be provided by the system when cross-compiling.
248248
build_pkgconfig() {
249249
local dir_name="pkg-config-${PKGCONFIG_VERSION}"
250250
local archive_name="${dir_name}.tar.gz"

0 commit comments

Comments
 (0)