From 591d9d71a7748b66ab63cf65014828796694d40d Mon Sep 17 00:00:00 2001 From: Stephen Saunders Date: Wed, 14 Dec 2022 12:50:05 -0500 Subject: [PATCH] Clean up macOS cmake build scripts and handle macOS makefile build path within Sys_DefaultBasePath() --- neo/cmake-macos-opengl-release.sh | 6 ------ neo/cmake-macos-opengl-retail.sh | 6 ------ neo/cmake-macos-vulkan-release.sh | 2 +- neo/cmake-macos-vulkan-retail.sh | 2 +- neo/cmake-xcode-opengl-debug.sh | 5 ----- neo/cmake-xcode-opengl-release.sh | 5 ----- neo/cmake-xcode-opengl-universal.sh | 6 ------ neo/cmake-xcode-vulkan-release.sh | 2 +- neo/cmake-xcode-vulkan-universal.sh | 2 +- neo/sys/posix/posix_main.cpp | 4 +++- 10 files changed, 7 insertions(+), 33 deletions(-) delete mode 100755 neo/cmake-macos-opengl-release.sh delete mode 100755 neo/cmake-macos-opengl-retail.sh delete mode 100755 neo/cmake-xcode-opengl-debug.sh delete mode 100755 neo/cmake-xcode-opengl-release.sh delete mode 100755 neo/cmake-xcode-opengl-universal.sh diff --git a/neo/cmake-macos-opengl-release.sh b/neo/cmake-macos-opengl-release.sh deleted file mode 100755 index 7981fd5b..00000000 --- a/neo/cmake-macos-opengl-release.sh +++ /dev/null @@ -1,6 +0,0 @@ -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_OSX_DEPLOYMENT_TARGET=10.12 -DSDL2=ON -DFFMPEG=OFF -DBINKDEC=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-opengl-retail.sh b/neo/cmake-macos-opengl-retail.sh deleted file mode 100755 index ce82e714..00000000 --- a/neo/cmake-macos-opengl-retail.sh +++ /dev/null @@ -1,6 +0,0 @@ -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="-DID_RETAIL" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DSDL2=ON -DFFMPEG=OFF -DBINKDEC=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 index d95ccba1..9c9db4cb 100755 --- a/neo/cmake-macos-vulkan-release.sh +++ b/neo/cmake-macos-vulkan-release.sh @@ -3,4 +3,4 @@ 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_OSX_DEPLOYMENT_TARGET=10.12 -DSDL2=ON -DFFMPEG=OFF -DBINKDEC=ON -DUSE_VULKAN=ON -DSPIRV_SHADERC=OFF -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 +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 index 8292b1b1..386796b0 100755 --- a/neo/cmake-macos-vulkan-retail.sh +++ b/neo/cmake-macos-vulkan-retail.sh @@ -3,4 +3,4 @@ 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="-DID_RETAIL" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DSDL2=ON -DFFMPEG=OFF -DBINKDEC=ON -DUSE_VULKAN=ON -DSPIRV_SHADERC=OFF -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 +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-opengl-debug.sh b/neo/cmake-xcode-opengl-debug.sh deleted file mode 100755 index fa5e1453..00000000 --- a/neo/cmake-xcode-opengl-debug.sh +++ /dev/null @@ -1,5 +0,0 @@ -cd .. -rm -rf xcode-opengl-debug -mkdir xcode-opengl-debug -cd xcode-opengl-debug -cmake -G Xcode -DCMAKE_BUILD_TYPE=Debug -DSDL2=ON -DCMAKE_XCODE_GENERATE_SCHEME=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-opengl-release.sh b/neo/cmake-xcode-opengl-release.sh deleted file mode 100755 index 90b06348..00000000 --- a/neo/cmake-xcode-opengl-release.sh +++ /dev/null @@ -1,5 +0,0 @@ -cd .. -rm -rf xcode-opengl-release -mkdir xcode-opengl-release -cd xcode-opengl-release -cmake -G Xcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_CONFIGURATION_TYPES="Release;MinSizeRel;RelWithDebInfo" -DSDL2=ON -DFFMPEG=OFF -DBINKDEC=ON -DCMAKE_XCODE_GENERATE_SCHEME=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-opengl-universal.sh b/neo/cmake-xcode-opengl-universal.sh deleted file mode 100755 index f5794814..00000000 --- a/neo/cmake-xcode-opengl-universal.sh +++ /dev/null @@ -1,6 +0,0 @@ -cd .. -rm -rf xcode-opengl-universal -mkdir xcode-opengl-universal -cd xcode-opengl-universal -# note: 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" -DSDL2=ON -DFFMPEG=OFF -DBINKDEC=ON -DCMAKE_XCODE_GENERATE_SCHEME=ON -DOPENAL_LIBRARY=/opt/local/lib/libopenal.dylib -DOPENAL_INCLUDE_DIR=/opt/local/include ../neo -Wno-dev diff --git a/neo/cmake-xcode-vulkan-release.sh b/neo/cmake-xcode-vulkan-release.sh index 4aadf0f0..fe0aba3c 100755 --- a/neo/cmake-xcode-vulkan-release.sh +++ b/neo/cmake-xcode-vulkan-release.sh @@ -5,4 +5,4 @@ cd xcode-vulkan-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_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_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 diff --git a/neo/cmake-xcode-vulkan-universal.sh b/neo/cmake-xcode-vulkan-universal.sh index 524b1495..7e82faaa 100755 --- a/neo/cmake-xcode-vulkan-universal.sh +++ b/neo/cmake-xcode-vulkan-universal.sh @@ -6,4 +6,4 @@ cd xcode-vulkan-universal # 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_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_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 diff --git a/neo/sys/posix/posix_main.cpp b/neo/sys/posix/posix_main.cpp index db64f9b9..481bf32d 100644 --- a/neo/sys/posix/posix_main.cpp +++ b/neo/sys/posix/posix_main.cpp @@ -470,10 +470,12 @@ const char* Sys_DefaultBasePath() { common->Printf( "no '%s' directory in macOS app bundle resources path %s, skipping\n", BASE_GAMEDIR, basepath.c_str() ); } +#endif // SRS - Check for macOS/linux build path (directory structure with build dir and possible config suffix) +#if defined(__APPLE__) && !defined( NO_MULTI_CONFIG ) basepath = exepath + "/../.."; // for macOS Xcode builds with Debug/Release/etc config suffix #else - basepath = exepath + "/.."; // for linux IDE and command line builds + basepath = exepath + "/.."; // for linux and macOS single-config makefile builds #endif testbase = basepath; testbase += "/";