From 8f286205eb2cde78230abcfefc266b4310f6ef54 Mon Sep 17 00:00:00 2001 From: ksuprynowicz Date: Sun, 31 Oct 2021 13:45:40 +0100 Subject: [PATCH] Added empty CPU architecture variable to Github builds to ensure compatibility --- .github/workflows/master_build.yml | 4 ++-- .github/workflows/pr_build.yml | 8 ++++---- BUILD.md | 4 +++- BUILD_LINUX.md | 2 ++ BUILD_OSX.md | 2 ++ 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/master_build.yml b/.github/workflows/master_build.yml index 8d9844e03c..c4be9234cc 100644 --- a/.github/workflows/master_build.yml +++ b/.github/workflows/master_build.yml @@ -56,7 +56,7 @@ jobs: echo "PYTHON_EXEC=python3" >> $GITHUB_ENV echo "INSTALLER_EXT=tgz" >> $GITHUB_ENV echo "CMAKE_BUILD_EXTRA=-- -j3" >> $GITHUB_ENV - echo "CMAKE_EXTRA=-DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV + echo "CMAKE_EXTRA=-DVIRCADIA_CPU_ARCHITECTURE= -DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV fi # Mac build variables if [ "${{ matrix.os }}" = "macOS-10.15" ]; then @@ -64,7 +64,7 @@ jobs: echo "ZIP_COMMAND=zip" >> $GITHUB_ENV echo "ZIP_ARGS=-r" >> $GITHUB_ENV echo "INSTALLER_EXT=dmg" >> $GITHUB_ENV - echo "CMAKE_EXTRA=-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV + echo "CMAKE_EXTRA=-DVIRCADIA_CPU_ARCHITECTURE= -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV echo "::set-output name=symbols_archive::${BUILD_NUMBER}-${{ matrix.build_type }}-mac-symbols.zip" echo "APP_TARGET_NAME=Vircadia" >> $GITHUB_ENV fi diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index 9bd3f7fb12..3addace0b7 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -75,9 +75,9 @@ jobs: echo "VCPKG_FORCE_SYSTEM_BINARIES=true" >> $GITHUB_ENV fi if [ "${{ matrix.build_type }}" = "full" ]; then - echo "CMAKE_EXTRA=-DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV + echo "CMAKE_EXTRA=-DVIRCADIA_CPU_ARCHITECTURE= -DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV else - echo "CMAKE_EXTRA=-DCLIENT_ONLY=1 -DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV + echo "CMAKE_EXTRA=-DVIRCADIA_CPU_ARCHITECTURE= -DCLIENT_ONLY=1 -DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV fi fi # Mac build variables @@ -85,9 +85,9 @@ jobs: echo "PYTHON_EXEC=python3" >> $GITHUB_ENV echo "INSTALLER_EXT=dmg" >> $GITHUB_ENV if [ "${{ matrix.build_type }}" = "full" ]; then - echo "CMAKE_EXTRA=-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV + echo "CMAKE_EXTRA=-DVIRCADIA_CPU_ARCHITECTURE= -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV else - echo "CMAKE_EXTRA=-DCLIENT_ONLY=1 -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV + echo "CMAKE_EXTRA=-DVIRCADIA_CPU_ARCHITECTURE= -DCLIENT_ONLY=1 -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV fi echo "APP_TARGET_NAME=Vircadia" >> $GITHUB_ENV fi diff --git a/BUILD.md b/BUILD.md index 469d934b95..fd30b124eb 100644 --- a/BUILD.md +++ b/BUILD.md @@ -195,7 +195,9 @@ The following build options can be used when running CMake ### Optimization build options * VIRCADIA_OPTIMIZE - This variable defaults to 1 if not set and enables compiler optimization flags on Linux and MacOS. Setting it to 0 will result in unoptimized build. -* VIRCADIA_CPU_ARCHITECTURE - This variable contains architecture specific compiler flags which are used if `VIRCADIA_OPTIMIZE` is true. If it is not set, it defaults to `-march=native -mtune=native`, which helps yield more performance for locally used build, but for packaging it needs to be set to different value for portability, for example `-msse3`. +* VIRCADIA_CPU_ARCHITECTURE - This variable contains architecture specific compiler flags which are used if `VIRCADIA_OPTIMIZE` is true. If it is not set, it defaults to `-march=native -mtune=native`, which helps yield more performance for locally used build, but for packaging it needs to be set to different value for portability, for example `-msse3`. Setting `VIRCADIA_CPU_ARCHITECTURE` to empty string will use default compiler settings and yield +maximum compatibility. + ### Developer Build Options diff --git a/BUILD_LINUX.md b/BUILD_LINUX.md index 04d8e8b63b..ae0a88a98e 100644 --- a/BUILD_LINUX.md +++ b/BUILD_LINUX.md @@ -177,3 +177,5 @@ CMake variable needs to be set to architecture specific value. It defaults to `-march=native -mtune=native`, which yields builds optimized for particular machine, but builds will not work on machines lacking same CPU instructions. For packaging and AppImage it is recommended to set it to different value, for example `-msse3`. +Setting `VIRCADIA_CPU_ARCHITECTURE` to empty string will use default compiler settings and yield +maximum compatibility. diff --git a/BUILD_OSX.md b/BUILD_OSX.md index e1fb030e39..03106b9354 100644 --- a/BUILD_OSX.md +++ b/BUILD_OSX.md @@ -71,6 +71,8 @@ CMake variable needs to be set to architecture specific value. It defaults to `-march=native -mtune=native`, which yields builds optimized for particular machine, but builds will not work on machines lacking same CPU instructions. For packaging and AppImage it is recommended to set it to different value, for example `-msse3`. +Setting `VIRCADIA_CPU_ARCHITECTURE` to empty string will use default compiler settings and yield +maximum compatibility. ## FAQ