Skip to content

Commit 1575051

Browse files
committed
[build-script] Disable pkg-config for Darwin hosts
1 parent d9d929a commit 1575051

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

utils/build-script

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,9 +655,12 @@ class BuildScriptInvocation(object):
655655
]
656656

657657
# Isolate build from the system; Darwin toolchains build against SDKs.
658-
args.extra_cmake_options.append(
659-
'-DCMAKE_IGNORE_PATH=/usr/lib;/usr/local/lib;/lib'
660-
)
658+
# For additional isolation, disable pkg-config. Homebrew's pkg-config
659+
# prioritizes CommandLineTools paths, resulting in compile errors.
660+
args.extra_cmake_options += [
661+
'-DCMAKE_IGNORE_PATH=/usr/lib;/usr/local/lib;/lib',
662+
'-DPKG_CONFIG_EXECUTABLE=/usr/bin/true',
663+
]
661664

662665
if toolchain.libtool is not None:
663666
impl_args += [

utils/build-script-impl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -632,17 +632,6 @@ function set_build_options_for_host() {
632632

633633
cmake_os_sysroot="$(xcrun --sdk ${platform} --show-sdk-path)"
634634

635-
# Customize the CMake `find_*` search paths to search the SDK
636-
# sysroot before searching `pkg-config` paths. This prevents compile
637-
# failures caused when `pkg-config` returns CommandLineTools paths
638-
# instead of Xcode paths.
639-
#
640-
# These search paths can be user customized either by setting the
641-
# `CMAKE_PREFIX_PATH` environment variable, or by setting the same
642-
# CMake variable via the command line (`-DCMAKE_PREFIX_PATH`).
643-
# See https://cmake.org/cmake/help/latest/command/find_path.html
644-
export CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:${cmake_os_sysroot}/usr"
645-
646635
cmark_cmake_options=(
647636
-DCMAKE_C_FLAGS="$(cmark_c_flags ${host})"
648637
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"

0 commit comments

Comments
 (0)