Skip to content

Commit

Permalink
Merge pull request #13 from RyeMutt/rye/universal
Browse files Browse the repository at this point in the history
Introduce macOS universal library build support for arm64
  • Loading branch information
RyeMutt authored Dec 10, 2024
2 parents 60a1fc0 + 44d7eb7 commit 20463b5
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
build:
strategy:
matrix:
os: [windows-2022, macos-12, ubuntu-22.04]
os: [windows-2022, macos-15, ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- uses: secondlife/action-autobuild@v4
- uses: secondlife/action-autobuild@v5
release:
needs: build
runs-on: [ubuntu-latest]
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ifneq ($(shell uname -p | grep -i powerpc),)
nativeArch := ppc
endif

# arch: x86 (or i386), x64 (or x86_64), ppc, ppc64
# arch: x86 (or i386), x64 (or x86_64), ppc, ppc64, arm64
arch ?= i386

# project: 'dom', 'domTest', or 'all'
Expand Down Expand Up @@ -103,7 +103,7 @@ $(error Invalid setting os=$(os))
endif

archs := $(sort $(subst i386,x86,$(arch)))
ifneq ($(filter-out x86 ppc x86_64,$(archs)),)
ifneq ($(filter-out x86 ppc x86_64 arm64,$(archs)),)
$(error Invalid setting arch=$(arch))
endif

Expand Down
54 changes: 27 additions & 27 deletions autobuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>6bf5f4afddf87d48c069d781b5ef2d44d6ddf2d5</string>
<string>320a8b76b1d30e5c1e7095c0c8315e8d0b68cbc5</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-boost/releases/download/v1.86.0-e2bee1e/boost-1.86-darwin64-10475904468.tar.zst</string>
<string>https://github.com/secondlife/3p-boost/releases/download/v1.86.0-dfe318c/boost-1.86-darwin64-11977000894.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
Expand All @@ -35,11 +35,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>3c0ba2a87e78d76c81da95fa87579bf4964242e1</string>
<string>589a3577448190f87dc1c3bb8149ff57780772d8</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-boost/releases/download/v1.86.0-e2bee1e/boost-1.86-linux64-10475904468.tar.zst</string>
<string>https://github.com/secondlife/3p-boost/releases/download/v1.86.0-dfe318c/boost-1.86-linux64-11977000894.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
Expand All @@ -49,11 +49,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>d1dd5d629b254d1b361c5a0fa210b5f3283e8a20</string>
<string>28a268d88e26f081bc2341400ca6a5bc72ac78a8</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-boost/releases/download/v1.86.0-e2bee1e/boost-1.86-windows64-10475904468.tar.zst</string>
<string>https://github.com/secondlife/3p-boost/releases/download/v1.86.0-dfe318c/boost-1.86-windows64-11977000894.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
Expand Down Expand Up @@ -81,11 +81,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>b2bf9adc84841b6fcf48d4c00787b221607cdea3</string>
<string>a7062e4feef42461b9acb4bfcef99bea5c89945e</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-libxml2/releases/download/v2.13.3-r1/libxml2-2.13.3-r1-darwin64-10329675166.tar.zst</string>
<string>https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r1/libxml2-2.13.5-r1-darwin64-11967192668.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
Expand All @@ -95,11 +95,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>6ab8108ea0a42e0bd462568c495e5ce5c4cdc0ff</string>
<string>991aad5931d5f05e43b8750ad81ae59ac6013e59</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-libxml2/releases/download/v2.13.3-r1/libxml2-2.13.3-r1-linux64-10329675166.tar.zst</string>
<string>https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r1/libxml2-2.13.5-r1-linux64-11967192668.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
Expand All @@ -109,18 +109,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>5181bd267de3ad4466227f91c7e2cbed7e8b85d9</string>
<string>4c00019229adc761673808567b8dcd64c7ba4a85</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-libxml2/releases/download/v2.13.3-r1/libxml2-2.13.3-r1-windows64-10329675166.tar.zst</string>
<string>https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r1/libxml2-2.13.5-r1-windows64-11967192668.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>2.13.3-r1</string>
<string>2.13.5-r1</string>
</map>
<key>minizip-ng</key>
<map>
Expand All @@ -143,11 +143,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>6bedaa9d770ef0ae6147f49a26fc3209fde9cb80</string>
<string>40ef787f43a47acb18fd06cb9605f2f1ec6273fd</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r1/minizip_ng-4.0.7-r1-darwin64-10324657515.tar.zst</string>
<string>https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r2/minizip_ng-4.0.7-r2-darwin64-11967198844.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
Expand All @@ -157,11 +157,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>ce2c91b8c4f89af252ce1b6a96af6985fe54f509</string>
<string>2c403efb5c59e7189b5e86a9001bb4f9e0647f6e</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r1/minizip_ng-4.0.7-r1-linux64-10324657515.tar.zst</string>
<string>https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r2/minizip_ng-4.0.7-r2-linux64-11967198844.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
Expand All @@ -171,18 +171,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>9cee9d85f9a7c6fb051125775f0122a926da5cc9</string>
<string>18a3d4adf09074f4ed97f7d086b30ce828d3508b</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r1/minizip_ng-4.0.7-r1-windows64-10324657515.tar.zst</string>
<string>https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r2/minizip_ng-4.0.7-r2-windows64-11967198844.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>4.0.7-r1</string>
<string>4.0.7-r2</string>
</map>
<key>zlib-ng</key>
<map>
Expand All @@ -205,11 +205,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>3a6593c71c59ace76d1349483759fcde4b719a76</string>
<string>4d437afc7fc3988cf0c78ed05853a211cc6bf8b8</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-darwin64-10324415171.tar.zst</string>
<string>https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-darwin64-11943461931.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
Expand All @@ -219,11 +219,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>fbadeb0b8c771cb06c0055c9fab6d40c6764dacd</string>
<string>70c1d8728b85481bd42904c1213ed50264e77be1</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-linux64-10324415171.tar.zst</string>
<string>https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-linux64-11943461931.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
Expand All @@ -233,18 +233,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>0094031715662be626f5106ff6c814f4fc3dacfa</string>
<string>f98c30b20120511ecceab8bf1b5eba048b10aade</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-windows64-10324415171.tar.zst</string>
<string>https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-windows64-11943461931.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>2.2.1-r2</string>
<string>2.2.2-dev0.gcaa101e.d20241120</string>
</map>
</map>
<key>package_description</key>
Expand Down
10 changes: 4 additions & 6 deletions build-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ case "$AUTOBUILD_PLATFORM" in
then
"build/$versub/domTest.exe" -all
else
# 64 bit exe ends up in different location to 32 bit hard coded
# 64 bit exe ends up in different location to 32 bit hard coded
# path to data directory - source code suggests it looks in a dir
# called domTestData first so we make one
mkdir -p "$projdir/x64/Release/domTestData"
Expand All @@ -111,7 +111,7 @@ case "$AUTOBUILD_PLATFORM" in
libname="libcollada${collada_shortver}dom${dom_shortver}-s.lib"
if [ "$AUTOBUILD_ADDRSIZE" = 32 ]
then cp -a "build/$versub/$libname" "$stage"/lib/release/
else cp -a "$projdir/x64/Release/$libname" "$stage"/lib/release/
else cp -a "$projdir/x64/Release/$libname" "$stage"/lib/release/
fi
;;

Expand All @@ -126,23 +126,21 @@ case "$AUTOBUILD_PLATFORM" in
# repo root run_tests suffix
export MACOSX_DEPLOYMENT_TARGET="$LL_BUILD_DARWIN_DEPLOY_TARGET"

opts="${TARGET_OPTS:--arch $AUTOBUILD_CONFIGURE_ARCH $LL_BUILD_RELEASE}"
opts="${TARGET_OPTS:--arch arm64 -arch x86_64 $LL_BUILD_RELEASE}"

nproc=$(sysctl -n hw.physicalcpu)

libdir="$top/stage"
mkdir -p "$libdir"/lib/release

make clean arch="$AUTOBUILD_CONFIGURE_ARCH" # Hide 'arch' env var

# Without the -Wno-etc flag, incredible spam is produced
make \
conf=release \
-j$nproc \
CFLAGS="$opts" \
CXXFLAGS="$opts -Wno-unused-local-typedef" \
LDFLAGS="-Wl,-headerpad_max_install_names" \
arch="$AUTOBUILD_CONFIGURE_ARCH" \
arch="x86_64 arm64" \
printCommands=yes \
printMessages=yes

Expand Down
2 changes: 1 addition & 1 deletion include/dae/daeArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class daeTArray : public daeArray
* @param other A reference to the other array.
* @return true if the arrays are equal, false otherwise.
*/
bool operator==(const daeTArray<T>& other) {
bool operator==(const daeTArray<T>& other) const {
if (getCount() != other.getCount())
return false;
for (size_t i = 0; i < getCount(); i++)
Expand Down
4 changes: 3 additions & 1 deletion make/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ ifeq ($(conf),debug)
ccFlags += -g -D_DEBUG
debugSuffix := -d
else
ccFlags += -O2 -DNDEBUG
ccFlags += -O3 -DNDEBUG
debugSuffix :=
endif

ifeq ($(arch),x86_64)
archsupport := -x64
else ifeq ($(arch),arm64)
archsupport := -a64
else
archsupport :=
endif
Expand Down
2 changes: 1 addition & 1 deletion make/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ifneq ($(obj),)
# any values we use in rule commands. This is the reason for all the target-specific variables.
$(obj): cc := $(cc)
$(obj): ccFlags := $(ccFlags)
$(obj): ccFlagsNoArch := $(filter-out -arch ppc ppc64 i386 x86_64,$(ccFlags))
$(obj): ccFlagsNoArch := $(filter-out -arch ppc ppc64 i386 x86_64 arm64,$(ccFlags))
$(obj): includeOpts := $(includeOpts)

# Call createObjRule with a source file path
Expand Down
2 changes: 1 addition & 1 deletion make/rulesC.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ifneq ($(obj),)
#$(obj): cc := $(cc)
$(obj): cc := $(CC)
$(obj): ccFlags := $(ccFlags)
$(obj): ccFlagsNoArch := $(filter-out -arch ppc ppc64 i386 x86_64,$(ccFlags))
$(obj): ccFlagsNoArch := $(filter-out -arch ppc ppc64 i386 x86_64 arm64,$(ccFlags))
$(obj): includeOpts := $(includeOpts)

# Call createObjRule with a source file path
Expand Down
2 changes: 1 addition & 1 deletion src/dae/daeMetaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ daeMetaElement::appendAttribute(daeMetaAttribute* attr)
else
_metaAttributes.append(attr);

if ((attr->getName() != NULL) &&
if ((daeString(attr->getName()) != NULL) &&
(strcmp(attr->getName(),"id") == 0)) {
_metaID = attr;
_isTrackableForQueries = true;
Expand Down

0 comments on commit 20463b5

Please sign in to comment.