Skip to content

Commit 56006cf

Browse files
Fix build with Xcode 11.4 (#48)
* CI: Update azohra/shell-linter to 0.3.0 * Fix build when using Xcode 11.4
1 parent 6563261 commit 56006cf

File tree

4 files changed

+70
-7
lines changed

4 files changed

+70
-7
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v1
1414
- name: shellcheck
15-
uses: azohra/[email protected]
15+
uses: azohra/[email protected]
16+
with:
17+
path: "*.sh"

boost.sh

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#
3030
#===============================================================================
3131

32-
BOOST_VERSION=1.69.0
32+
BOOST_VERSION=1.72.0
3333

3434
BOOST_LIBS="atomic chrono date_time exception filesystem program_options random system thread test"
3535
ALL_BOOST_LIBS_1_68="atomic chrono container context coroutine coroutine2
@@ -43,15 +43,12 @@ system test thread timer type_erasure wave"
4343
BOOTSTRAP_LIBS=""
4444

4545
MIN_IOS_VERSION=11.0
46-
IOS_SDK_VERSION=$(xcrun --sdk iphoneos --show-sdk-version)
4746

4847
MIN_TVOS_VERSION=11.0
49-
TVOS_SDK_VERSION=$(xcrun --sdk appletvos --show-sdk-version)
5048
TVOS_SDK_PATH=$(xcrun --sdk appletvos --show-sdk-path)
5149
TVOSSIM_SDK_PATH=$(xcrun --sdk appletvsimulator --show-sdk-path)
5250

5351
MIN_MACOS_VERSION=10.12
54-
MACOS_SDK_VERSION=$(xcrun --sdk macosx --show-sdk-version)
5552
MACOS_SDK_PATH=$(xcrun --sdk macosx --show-sdk-path)
5653

5754
MACOS_ARCHS=("x86_64")
@@ -61,6 +58,7 @@ IOS_SIM_ARCHS=("i386" "x86_64")
6158
# Applied to all platforms
6259
CXX_FLAGS="-std=c++14 -stdlib=libc++"
6360

61+
XCODE_VERSION=$(xcrun xcodebuild -version | head -n1 | tr -Cd '[:digit:].')
6462
XCODE_ROOT=$(xcode-select -print-path)
6563
COMPILER="$XCODE_ROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
6664

@@ -81,6 +79,17 @@ BUILD_VARIANT=release
8179
# Functions
8280
#===============================================================================
8381

82+
sdkVersion()
83+
{
84+
FULL_VERSION=$(xcrun --sdk "$1" --show-sdk-version)
85+
read -ra VERSION <<< "${FULL_VERSION//./ }"
86+
echo "${VERSION[0]}.${VERSION[1]}"
87+
}
88+
89+
IOS_SDK_VERSION=$(sdkVersion iphoneos)
90+
TVOS_SDK_VERSION=$(sdkVersion appletvos)
91+
MACOS_SDK_VERSION=$(sdkVersion macosx)
92+
8493
usage()
8594
{
8695
cat << EOF
@@ -550,6 +559,22 @@ unpackBoost()
550559

551560
#===============================================================================
552561

562+
patchBoost()
563+
{
564+
echo "Patching boost in $BOOST_SRC"
565+
566+
if [ "$(version "$BOOST_VERSION")" -le "$(version "1.72.0")" ] &&
567+
[ "$(version "$XCODE_VERSION")" -ge "$(version "11.4")" ]
568+
then
569+
# https://github.com/boostorg/build/pull/560
570+
(cd "$BOOST_SRC" && patch --forward -p1 -d "$BOOST_SRC/tools/build" < "$CURRENT_DIR/patches/xcode-11.4.patch")
571+
fi
572+
573+
doneSection
574+
}
575+
576+
#===============================================================================
577+
553578
inventMissingHeaders()
554579
{
555580
# These files are missing in the ARM iPhoneOS SDK, but they are in the simulator.
@@ -1206,6 +1231,7 @@ fi
12061231
downloadBoost
12071232
unpackBoost
12081233
inventMissingHeaders
1234+
patchBoost
12091235

12101236
if [[ -n $BUILD_IOS ]]; then
12111237
updateBoost "iOS"

changelog

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
-- 2020-04-18 --
2+
* Updated default boost version to 1.72.0
3+
* Fixed error "unknown argument: '-fcoalesce-templates'" when building with Xcode 11.4 (#45)
4+
15
-- 2020-04-08 --
2-
* Add shellcheck to CI
3-
* Fix all shellcheck warnings
6+
* Added shellcheck to CI
7+
* Fixed all shellcheck warnings
48

59
-- 2019-09-20 --
610
* Use bintray rather than sourceforge for downloads

patches/xcode-11.4.patch

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From 40960b23338da0a359d6aa83585ace09ad8804d2 Mon Sep 17 00:00:00 2001
2+
From: Bo Anderson <[email protected]>
3+
Date: Sun, 29 Mar 2020 14:55:08 +0100
4+
Subject: [PATCH] Fix compiler version check on macOS
5+
6+
Fixes #440.
7+
---
8+
src/tools/darwin.jam | 5 +++--
9+
1 file changed, 3 insertions(+), 2 deletions(-)
10+
11+
diff --git a/src/tools/darwin.jam b/src/tools/darwin.jam
12+
index 8d477410b0..97e7ecb851 100644
13+
--- a/src/tools/darwin.jam
14+
+++ b/src/tools/darwin.jam
15+
@@ -137,13 +137,14 @@ rule init ( version ? : command * : options * : requirement * )
16+
# - Set the toolset generic common options.
17+
common.handle-options darwin : $(condition) : $(command) : $(options) ;
18+
19+
+ real-version = [ regex.split $(real-version) \\. ] ;
20+
# - GCC 4.0 and higher in Darwin does not have -fcoalesce-templates.
21+
- if $(real-version) < "4.0.0"
22+
+ if [ version.version-less $(real-version) : 4 0 ]
23+
{
24+
flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ;
25+
}
26+
# - GCC 4.2 and higher in Darwin does not have -Wno-long-double.
27+
- if $(real-version) < "4.2.0"
28+
+ if [ version.version-less $(real-version) : 4 2 ]
29+
{
30+
flags darwin.compile OPTIONS $(condition) : -Wno-long-double ;
31+
}

0 commit comments

Comments
 (0)