From 26edabe75205def62e39bc80cfabb5616a7143c3 Mon Sep 17 00:00:00 2001 From: Stephen Saunders Date: Sun, 8 Jan 2023 00:30:02 -0500 Subject: [PATCH] Rename / update macOS cmake build scripts, update README to reflect new names --- README.md | 12 ++++++------ neo/cmake-macos-release.sh | 6 ++++++ neo/cmake-macos-retail.sh | 6 ++++++ neo/cmake-macos-vulkan-release.sh | 6 ------ neo/cmake-macos-vulkan-retail.sh | 6 ------ ...ke-xcode-vulkan-debug.sh => cmake-xcode-debug.sh} | 8 ++++---- ...code-vulkan-release.sh => cmake-xcode-release.sh} | 8 ++++---- ...-vulkan-universal.sh => cmake-xcode-universal.sh} | 8 ++++---- 8 files changed, 30 insertions(+), 30 deletions(-) create mode 100755 neo/cmake-macos-release.sh create mode 100755 neo/cmake-macos-retail.sh delete mode 100755 neo/cmake-macos-vulkan-release.sh delete mode 100755 neo/cmake-macos-vulkan-retail.sh rename neo/{cmake-xcode-vulkan-debug.sh => cmake-xcode-debug.sh} (63%) rename neo/{cmake-xcode-vulkan-release.sh => cmake-xcode-release.sh} (60%) rename neo/{cmake-xcode-vulkan-universal.sh => cmake-xcode-universal.sh} (62%) diff --git a/README.md b/README.md index 2bd3bcb2..6048ab89 100644 --- a/README.md +++ b/README.md @@ -498,14 +498,14 @@ Recommended in this case is `cmake-vs2019-64bit.bat` or `cmake-vs2019-64bit-no-f For command line builds: > cd neo/ - > ./cmake-macos-opengl-release.sh + > ./cmake-macos-release.sh For Xcode builds: > cd neo/ - > ./cmake-xcode-opengl-release.sh + > ./cmake-xcode-release.sh or - > ./cmake-xcode-opengl-universal.sh (universal build on macOS Big Sur / Xcode 12.2 or later) + > ./cmake-xcode-universal.sh (universal build on macOS Big Sur / Xcode 12.2 or later) Depending on which package manager you install (Homebrew or MacPorts) you may need to change the openal-soft library and include paths specified in the cmake shell scripts. For single architecture builds (debug, release, retail) the default openal-soft paths are set for Homebrew on x86, while for universal builds the default paths are set for MacPorts on x86 or Apple Silicon. If you want to build using the single architecture shell scripts (debug, release, retail) on Apple Silicon, you will need to change the openal-soft paths from `/usr/local/...` to either `/opt/homebrew/...` (Homebrew) or `/opt/local/...` (MacPorts). @@ -516,7 +516,7 @@ Recommended in this case is `cmake-vs2019-64bit.bat` or `cmake-vs2019-64bit-no-f > cd ../build > make - For Xcode builds double click on RBDOOM-3-BFG/xcode-opengl-\/RBDoom3BFG.xcodeproj and start the build. The generated Xcode project file is pre-configured with the correct targets and build settings. + For Xcode builds double click on RBDOOM-3-BFG/xcode-\/RBDoom3BFG.xcodeproj and start the build. The generated Xcode project file is pre-configured with the correct targets and build settings. --- # Installation, Getting the Game Data, Running the Game @@ -609,11 +609,11 @@ Anyway: * _common.crc * (etc) -5. On macOS the RBDoom3BFG executable will also search for game data within an app bundle's relative path ../Resources/base and, as a last resort, within the absolute path /Applications/RBDoom-3-BFG.app/Contents/Resources/base. In addition, if you want the game to be standalone without dependencies on pre-installed dynamic libs, you can use macdylibbundler to bundle all external dylib dependencies into the app bundle (see https://github.com/auriamg/macdylibbundler or simply install via "brew install dylibbundler" or "sudo port install dylibbundler"). For example, the following command will copy all external dynamic library dependencies to the Contents/libs directory of the game's app bundle and adjust the rpaths within the RBDoom3BFG executable and copied dylibs. +5. On macOS the RBDoom3BFG executable will also search for game data within an app bundle's Contents/Resources/base folder, and as a last resort, within the absolute path /Applications/RBDoom-3-BFG.app/Contents/Resources/base. In addition, if you want the game to be standalone without dependencies on pre-installed dynamic libs, you can use macdylibbundler to bundle all external dylib dependencies into the app bundle (see https://github.com/auriamg/macdylibbundler or simply install via "brew install dylibbundler" or "sudo port install dylibbundler"). For example, the following command will copy all external dylib dependencies to the Contents/libs directory of the game's app bundle and adjust the rpaths within the RBDoom3BFG executable and copied dylibs. > dylibbundler -od -b -x RBDoom-3-BFG.app/Contents/MacOS/RBDoom3BFG -d RBDoom-3-BFG.app/Contents/libs/ - After running dylibbundler you must re-sign the modified executable and dylibs if planning to run on **Apple Silicon** machines. The output of dylibbundler will indicate which dylibs (if any) require re-signing. This code signing step is not needed for x86-based Macs. + After running dylibbundler you may need to re-sign the modified executable and dylibs if planning to run on **Apple Silicon** machines. Newer versions of dylibbundler now do this automatically. The output of dylibbundler will indicate which executable and dylibs (if any) require re-signing. This code signing step is not needed for x86-based Macs. > codesign -s - --force RBDoom-3-BFG.app/Contents/libs/lib.dylib ... diff --git a/neo/cmake-macos-release.sh b/neo/cmake-macos-release.sh new file mode 100755 index 00000000..450a451a --- /dev/null +++ b/neo/cmake-macos-release.sh @@ -0,0 +1,6 @@ +cd .. +rm -rf build +mkdir build +cd build +# change or remove -DCMAKE_OSX_DEPLOYMENT_TARGET= to match supported runtime targets +cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG -DNO_MULTI_CONFIG" -DCMAKE_OSX_DEPLOYMENT_TARGET=12.1 -DFFMPEG=OFF -DBINKDEC=ON -DUSE_MoltenVK=ON -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib -DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include ../neo -Wno-dev diff --git a/neo/cmake-macos-retail.sh b/neo/cmake-macos-retail.sh new file mode 100755 index 00000000..2999f229 --- /dev/null +++ b/neo/cmake-macos-retail.sh @@ -0,0 +1,6 @@ +cd .. +rm -rf build +mkdir build +cd build +# change or remove -DCMAKE_OSX_DEPLOYMENT_TARGET= to match supported runtime targets +cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG -DNO_MULTI_CONFIG -DID_RETAIL" -DCMAKE_OSX_DEPLOYMENT_TARGET=12.1 -DFFMPEG=OFF -DBINKDEC=ON -DUSE_MoltenVK=ON -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib -DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include ../neo -Wno-dev diff --git a/neo/cmake-macos-vulkan-release.sh b/neo/cmake-macos-vulkan-release.sh deleted file mode 100755 index 9c9db4cb..00000000 --- a/neo/cmake-macos-vulkan-release.sh +++ /dev/null @@ -1,6 +0,0 @@ -cd .. -rm -rf build-vulkan -mkdir build-vulkan -cd build-vulkan -# change or remove -DCMAKE_OSX_DEPLOYMENT_TARGET= to match supported runtime targets -cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG -DNO_MULTI_CONFIG" -DCMAKE_OSX_DEPLOYMENT_TARGET=12.1 -DFFMPEG=OFF -DBINKDEC=ON -DUSE_VULKAN=ON -DUSE_MoltenVK=ON -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib -DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include ../neo -Wno-dev diff --git a/neo/cmake-macos-vulkan-retail.sh b/neo/cmake-macos-vulkan-retail.sh deleted file mode 100755 index 386796b0..00000000 --- a/neo/cmake-macos-vulkan-retail.sh +++ /dev/null @@ -1,6 +0,0 @@ -cd .. -rm -rf build-vulkan -mkdir build-vulkan -cd build-vulkan -# change or remove -DCMAKE_OSX_DEPLOYMENT_TARGET= to match supported runtime targets -cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG -DNO_MULTI_CONFIG -DID_RETAIL" -DCMAKE_OSX_DEPLOYMENT_TARGET=12.1 -DFFMPEG=OFF -DBINKDEC=ON -DUSE_VULKAN=ON -DUSE_MoltenVK=ON -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib -DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include ../neo -Wno-dev diff --git a/neo/cmake-xcode-vulkan-debug.sh b/neo/cmake-xcode-debug.sh similarity index 63% rename from neo/cmake-xcode-vulkan-debug.sh rename to neo/cmake-xcode-debug.sh index 6e9489a0..66d77134 100755 --- a/neo/cmake-xcode-vulkan-debug.sh +++ b/neo/cmake-xcode-debug.sh @@ -1,10 +1,10 @@ cd .. -rm -rf xcode-vulkan-debug -mkdir xcode-vulkan-debug -cd xcode-vulkan-debug +rm -rf xcode-debug +mkdir xcode-debug +cd xcode-debug # note 1: remove or set -DCMAKE_SUPPRESS_REGENERATION=OFF to reenable ZERO_CHECK target which checks for CMakeLists.txt changes and re-runs CMake before builds # however, if ZERO_CHECK is reenabled **must** add VULKAN_SDK location to Xcode Custom Paths (under Prefs/Locations) otherwise build failures may occur # note 2: policy CMAKE_POLICY_DEFAULT_CMP0142=NEW suppresses non-existant per-config suffixes on Xcode library search paths, works for cmake version 3.25 and later #note 3: env variable MVK_CONFIG_FULL_IMAGE_VIEW_SWIZZLE=1 enables MoltenVK's image view swizzle which may be required on older macOS versions or hardware (see vulkaninfo) # note 4: env variable MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS=2 enables MoltenVK's use of Metal argument buffers only if VK_EXT_descriptor_indexing is enabled -cmake -G Xcode -DCMAKE_BUILD_TYPE=Debug -DUSE_VULKAN=ON -DCMAKE_XCODE_GENERATE_SCHEME=ON -DCMAKE_XCODE_SCHEME_ENVIRONMENT="MVK_CONFIG_FULL_IMAGE_VIEW_SWIZZLE=1;MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS=2" -DCMAKE_SUPPRESS_REGENERATION=ON -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib -DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include ../neo -DCMAKE_POLICY_DEFAULT_CMP0142=NEW -Wno-dev +cmake -G Xcode -DCMAKE_BUILD_TYPE=Debug -DCMAKE_XCODE_GENERATE_SCHEME=ON -DCMAKE_XCODE_SCHEME_ENVIRONMENT="MVK_CONFIG_FULL_IMAGE_VIEW_SWIZZLE=1;MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS=2" -DCMAKE_SUPPRESS_REGENERATION=ON -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib -DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include ../neo -DCMAKE_POLICY_DEFAULT_CMP0142=NEW -Wno-dev diff --git a/neo/cmake-xcode-vulkan-release.sh b/neo/cmake-xcode-release.sh similarity index 60% rename from neo/cmake-xcode-vulkan-release.sh rename to neo/cmake-xcode-release.sh index fe0aba3c..9577d032 100755 --- a/neo/cmake-xcode-vulkan-release.sh +++ b/neo/cmake-xcode-release.sh @@ -1,8 +1,8 @@ cd .. -rm -rf xcode-vulkan-release -mkdir xcode-vulkan-release -cd xcode-vulkan-release +rm -rf xcode-release +mkdir xcode-release +cd xcode-release # note 1: remove or set -DCMAKE_SUPPRESS_REGENERATION=OFF to reenable ZERO_CHECK target which checks for CMakeLists.txt changes and re-runs CMake before builds # however, if ZERO_CHECK is reenabled **must** add VULKAN_SDK location to Xcode Custom Paths (under Prefs/Locations) otherwise build failures may occur # note 2: policy CMAKE_POLICY_DEFAULT_CMP0142=NEW suppresses non-existant per-config suffixes on Xcode library search paths, works for cmake version 3.25 and later -cmake -G Xcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_CONFIGURATION_TYPES="Release;MinSizeRel;RelWithDebInfo" -DFFMPEG=OFF -DBINKDEC=ON -DUSE_VULKAN=ON -DUSE_MoltenVK=ON -DCMAKE_XCODE_GENERATE_SCHEME=ON -DCMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION=OFF -DCMAKE_SUPPRESS_REGENERATION=ON -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib -DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include ../neo -DCMAKE_POLICY_DEFAULT_CMP0142=NEW -Wno-dev +cmake -G Xcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_CONFIGURATION_TYPES="Release;MinSizeRel;RelWithDebInfo" -DFFMPEG=OFF -DBINKDEC=ON -DUSE_MoltenVK=ON -DCMAKE_XCODE_GENERATE_SCHEME=ON -DCMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION=OFF -DCMAKE_SUPPRESS_REGENERATION=ON -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib -DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include ../neo -DCMAKE_POLICY_DEFAULT_CMP0142=NEW -Wno-dev diff --git a/neo/cmake-xcode-vulkan-universal.sh b/neo/cmake-xcode-universal.sh similarity index 62% rename from neo/cmake-xcode-vulkan-universal.sh rename to neo/cmake-xcode-universal.sh index 7e82faaa..63ff3977 100755 --- a/neo/cmake-xcode-vulkan-universal.sh +++ b/neo/cmake-xcode-universal.sh @@ -1,9 +1,9 @@ cd .. -rm -rf xcode-vulkan-universal -mkdir xcode-vulkan-universal -cd xcode-vulkan-universal +rm -rf xcode-universal +mkdir xcode-universal +cd xcode-universal # note 1: remove or set -DCMAKE_SUPPRESS_REGENERATION=OFF to reenable ZERO_CHECK target which checks for CMakeLists.txt changes and re-runs CMake before builds # however, if ZERO_CHECK is reenabled **must** add VULKAN_SDK location to Xcode Custom Paths (under Prefs/Locations) otherwise build failures may occur # note 2: policy CMAKE_POLICY_DEFAULT_CMP0142=NEW suppresses non-existant per-config suffixes on Xcode library search paths, works for cmake version 3.25 and later # note 3: universal openal-soft library and include paths assume MacPorts install locations -cmake -G Xcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_CONFIGURATION_TYPES="Release;MinSizeRel;RelWithDebInfo" -DFFMPEG=OFF -DBINKDEC=ON -DUSE_VULKAN=ON -DUSE_MoltenVK=ON -DCMAKE_XCODE_GENERATE_SCHEME=ON -DCMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION=OFF -DCMAKE_SUPPRESS_REGENERATION=ON -DOPENAL_LIBRARY=/opt/local/lib/libopenal.dylib -DOPENAL_INCLUDE_DIR=/opt/local/include ../neo -DCMAKE_POLICY_DEFAULT_CMP0142=NEW -Wno-dev +cmake -G Xcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_CONFIGURATION_TYPES="Release;MinSizeRel;RelWithDebInfo" -DFFMPEG=OFF -DBINKDEC=ON -DUSE_MoltenVK=ON -DCMAKE_XCODE_GENERATE_SCHEME=ON -DCMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION=OFF -DCMAKE_SUPPRESS_REGENERATION=ON -DOPENAL_LIBRARY=/opt/local/lib/libopenal.dylib -DOPENAL_INCLUDE_DIR=/opt/local/include ../neo -DCMAKE_POLICY_DEFAULT_CMP0142=NEW -Wno-dev