forked from qt-creator/qt-creator
Fix Botan build on macOS
Since some Xcode version, running clang directly from the Toolchains directory requires explicitly passing the sysroot to use. If that is not done, inclusion of some standard headers like string.h fails. Change-Id: I640eca41d4132354f1091a7514586cb582e5d05c Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -30,7 +30,7 @@ mingw {
|
||||
BOTAN_CXX_FLAGS =
|
||||
msvc: BOTAN_CXX_FLAGS += /wd4127 /wd4244 /wd4250 /wd4267 /wd4334 /wd4702 /wd4996
|
||||
else: BOTAN_CXX_FLAGS += -Wno-unused-parameter
|
||||
macos: BOTAN_CXX_FLAGS += -mmacosx-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET
|
||||
macos: BOTAN_CXX_FLAGS += -mmacosx-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET -isysroot $$shell_quote($$QMAKE_MAC_SDK.macosx.Path)
|
||||
unix: BOTAN_CXX_FLAGS += -fPIC
|
||||
!isEmpty(BOTAN_CXX_FLAGS): OTHER_FLAGS += --cxxflags=$$shell_quote($$BOTAN_CXX_FLAGS)
|
||||
win32: OTHER_FLAGS += --link-method=hardlink
|
||||
|
@@ -6,6 +6,7 @@ Product {
|
||||
type: ["staticlibrary", "hpp"]
|
||||
Depends { name: "cpp" }
|
||||
Depends { name: "qtc" }
|
||||
Depends { name: "xcode"; condition: qbs.toolchain.contains("xcode") }
|
||||
files: "update-botan.sh"
|
||||
Group {
|
||||
name: "Botan sources"
|
||||
@@ -47,8 +48,11 @@ Product {
|
||||
}
|
||||
else if (product.qbs.toolchain.contains("gcc"))
|
||||
cxxFlags.push("-Wno-unused-parameter");
|
||||
if (product.qbs.targetOS.contains("macos"))
|
||||
if (product.qbs.targetOS.contains("macos")) {
|
||||
cxxFlags.push("-mmacosx-version-min=" + project.minimumMacosVersion);
|
||||
if (product.qbs.toolchain.contains("xcode"))
|
||||
cxxFlags.push("-isysroot", product.xcode.sdkPath);
|
||||
}
|
||||
if (product.qbs.targetOS.contains("unix"))
|
||||
cxxFlags.push("-fPIC");
|
||||
if (cxxFlags.length > 0)
|
||||
|
Reference in New Issue
Block a user