Skip to content

Commit 719bed5

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 4f9c5d2 commit 719bed5

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
@@ -260,8 +260,8 @@ log_build() {
260260
esac
261261
}
262262

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

0 commit comments

Comments
 (0)