diff options
| author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-09-27 17:04:07 +0200 |
|---|---|---|
| committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-10-27 16:22:34 +0200 |
| commit | d496ffdac10eaad74af4142510fbf979bab340c2 (patch) | |
| tree | 3599f00a59647bdca8b8e3621a4ce4bc4c9e5ce6 /examples/declarative/referenceexamples/adding/adding.pyproject | |
| parent | 923814d989bae1575fed80339cecb11de10946c9 (diff) | |
CMake: Don't use pkg-config by default when building for macOS
Certain CMake Find modules use pkg-config to try and find libraries.
The libxml2 and libxslt libraries that shiboken needs
are provided by both Homebrew and the macOS SDK.
Homebrew ships two sets of .pc files for xml and xslt:
- one set pointing to the Homebrew libs which are NOT symlinked into
/usr/local by default, and are thus not found by default
- another set pointing to the Xcode command line tools files which
are symlinked into /usr/local by default. Note these point to the
command line tools SDK, not the macOS SDK, which is an important
distinction.
Unfortunately the latter can cause issues when building shiboken,
because CMake's find_package() uses FindPkgConfig and
the Command Line Tools libxml2.pc file is found.
CMake then adds the CLT include paths in addition to the default macOS
SDK sysroot include paths and that mix leads to compilation errors.
E.g.
-I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include
gets mixed up with
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/
MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk
causing errors like
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/cmath:317:9: error: no member named 'signbit' in the
global namespace
By default when targeting macOS, pkg-config should not be used, to
ensure 3rd party dependencies are not picked up and mixed with the
macOS SDK provided dependencies.
This is in-line with the behavior of Qt's CMake build as well.
Disable the usage of pkg-config by setting PKG_CONFIG_EXECUTABLE to an
empty string by default.
Allow to opt into usage of pkg-config by configuring shiboken with
the -DSHIBOKEN_SKIP_PKG_CONFIG_ADJUSTMENT=ON option.
Pick-to: 6.2
Change-Id: Iec2acc4026f12a7baac4afb4259aeacd9e3b32b4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/declarative/referenceexamples/adding/adding.pyproject')
0 files changed, 0 insertions, 0 deletions
