2020-06-23 16:08:00 -04:00
|
|
|
XC_PROJ := MoltenVKPackaging.xcodeproj
|
|
|
|
XC_SCHEME := MoltenVK Package
|
2018-10-30 23:16:12 -04:00
|
|
|
|
2020-12-09 09:36:17 -05:00
|
|
|
XCODEBUILD := set -o pipefail && $(shell command -v xcodebuild)
|
|
|
|
# Used to determine if xcpretty is available
|
|
|
|
XCPRETTY_PATH := $(shell command -v xcpretty 2> /dev/null)
|
|
|
|
|
|
|
|
OUTPUT_FMT_CMD =
|
|
|
|
ifdef XCPRETTY_PATH
|
|
|
|
# Pipe output to xcpretty, while preserving full log as xcodebuild.log
|
|
|
|
OUTPUT_FMT_CMD = | tee "xcodebuild.log" | xcpretty -c
|
|
|
|
else
|
|
|
|
# Use xcodebuild -quiet parameter
|
|
|
|
OUTPUT_FMT_CMD = -quiet
|
|
|
|
endif
|
|
|
|
|
2024-01-10 17:16:33 -05:00
|
|
|
# Collect all build settings defined on the command-line (eg: MVK_HIDE_VULKAN_SYMBOLS=1, MVK_CONFIG_LOG_LEVEL=3...)
|
2022-09-23 11:30:22 +02:00
|
|
|
MAKEARGS := $(strip \
|
|
|
|
$(foreach v,$(.VARIABLES),\
|
|
|
|
$(if $(filter command\ line,$(origin $(v))),\
|
|
|
|
$(v)=$(value $(v)) ,)))
|
2021-11-17 18:22:33 -05:00
|
|
|
|
2020-06-22 15:56:22 -04:00
|
|
|
# Specify individually (not as dependencies) so the sub-targets don't run in parallel
|
2023-07-11 14:22:59 -04:00
|
|
|
# visionos and visionossim are currently excluded from `all` because they require
|
|
|
|
# Xcode 15+ and will abort a multi-platform build on earlier Xcode versions.
|
2018-10-30 23:16:12 -04:00
|
|
|
.PHONY: all
|
|
|
|
all:
|
2020-08-27 19:29:14 -04:00
|
|
|
@$(MAKE) macos
|
2020-09-01 14:39:46 -04:00
|
|
|
@$(MAKE) ios
|
|
|
|
@$(MAKE) iossim
|
2020-11-30 18:52:34 -05:00
|
|
|
@$(MAKE) maccat
|
2020-09-01 14:39:46 -04:00
|
|
|
@$(MAKE) tvos
|
|
|
|
@$(MAKE) tvossim
|
2023-07-11 14:22:59 -04:00
|
|
|
# @$(MAKE) visionos # Requires Xcode 15+
|
|
|
|
# @$(MAKE) visionossim # Requires Xcode 15+
|
2018-10-30 23:16:12 -04:00
|
|
|
|
2020-06-23 16:08:00 -04:00
|
|
|
.PHONY: all-debug
|
|
|
|
all-debug:
|
2020-08-27 19:29:14 -04:00
|
|
|
@$(MAKE) macos-debug
|
2020-09-01 14:39:46 -04:00
|
|
|
@$(MAKE) ios-debug
|
|
|
|
@$(MAKE) iossim-debug
|
2020-11-30 18:52:34 -05:00
|
|
|
@$(MAKE) maccat-debug
|
2020-09-01 14:39:46 -04:00
|
|
|
@$(MAKE) tvos-debug
|
|
|
|
@$(MAKE) tvossim-debug
|
2023-07-11 14:22:59 -04:00
|
|
|
# @$(MAKE) visionos-debug # Requires Xcode 15+
|
|
|
|
# @$(MAKE) visionossim-debug # Requires Xcode 15+
|
2020-06-23 16:08:00 -04:00
|
|
|
|
2018-10-30 23:16:12 -04:00
|
|
|
.PHONY: macos
|
|
|
|
macos:
|
2022-09-30 00:17:27 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (macOS only)" -destination "generic/platform=macOS" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
2020-06-23 16:08:00 -04:00
|
|
|
|
|
|
|
.PHONY: macos-debug
|
|
|
|
macos-debug:
|
2022-09-30 00:17:27 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (macOS only)" -destination "generic/platform=macOS" -configuration "Debug" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
2018-10-30 23:16:12 -04:00
|
|
|
|
|
|
|
.PHONY: ios
|
|
|
|
ios:
|
2022-09-30 00:17:27 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=iOS" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
2020-06-23 16:08:00 -04:00
|
|
|
|
|
|
|
.PHONY: ios-debug
|
|
|
|
ios-debug:
|
2022-09-30 00:17:27 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=iOS" -configuration "Debug" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
2018-10-30 23:16:12 -04:00
|
|
|
|
2020-09-01 14:39:46 -04:00
|
|
|
.PHONY: iossim
|
|
|
|
iossim:
|
2022-09-30 00:17:27 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=iOS Simulator" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
2020-06-23 16:08:00 -04:00
|
|
|
|
2020-09-01 14:39:46 -04:00
|
|
|
.PHONY: iossim-debug
|
|
|
|
iossim-debug:
|
2022-09-30 00:17:27 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=iOS Simulator" -configuration "Debug" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
2020-06-22 15:56:22 -04:00
|
|
|
|
2020-11-30 18:52:34 -05:00
|
|
|
.PHONY: maccat
|
|
|
|
maccat:
|
Improve support for iOS App Store rules by using dynamic XCFramework.
Apple's iOS App Store does not permit an app to link to naked dylibs.
Instead, these must be placed in frameworks, which are embedded in a
dynamic version of MoltenVK.xcframework.
- Use Xcode to directly generate a MoltenVK.framework for each platform,
and remove create_dylib*.sh scripts.
- Move static XCFramework, containing libMoltenVK.a static libraries,
to Package/Latest/MoltenVK/static/MoltenVK.xcframework.
- Generate dynamic XCFramework, containing MoltenVK.framework dynamic
libraries, in Package/Latest/MoltenVK/dynamic/MoltenVK.xcframework.
- Add macro MVK_VERSION_STRING to create version string at compile time,
use it to validate the CURRENT_PROJECT_VERSION build setting at compile time,
and use it at runtime instead of mvkGetMoltenVKVersionString() function.
- Add -w to OTHER_LDFLAGS to dynamic framework builds to suppress
spurious linker warnings of the type
"ld: warning: no platform load command found in '...', assuming: iOS"
issued from the new linker introduced in Xcode 15.
- Add MoltenVK-MacCat Xcode target and MoltenVK Package (MacCat only)
Xcode scheme to avoid building dynamic MoltenVK.framework for the
Mac Catalyst platform, because Xcode does not support doing so.
- Always run MoltenVK build scripts, to ensure all components are
added to the XCFrameworks, and MoltenVK/Package is always refreshed,
even if code compilation is not required.
- Cube demo link to dynamic MoltenVK.framework through
dynamic/MoltenVK.xcframework, instead of to naked libMoltenVK.dylib.
- Update the version of Volk used by the Cube demo, to support
loading MoltenVK from dynamic frameworks inside Volk.
- Update README.md and MoltenVK_Runtime_UserGuide.md documents.
- Update MVK_PRIVATE_API_VERSION to 40.
- Fix make install to install /usr/local/lib/libMoltenVK.dylib on macOS (unrelated).
- Remove unused MTLAttributeStrideStatic declaration prior to Xcode 15 (unrelated).
2024-02-29 22:03:44 -05:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (MacCat only)" -destination "generic/platform=macOS,variant=Mac Catalyst" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
2020-11-30 18:52:34 -05:00
|
|
|
|
|
|
|
.PHONY: maccat-debug
|
|
|
|
maccat-debug:
|
Improve support for iOS App Store rules by using dynamic XCFramework.
Apple's iOS App Store does not permit an app to link to naked dylibs.
Instead, these must be placed in frameworks, which are embedded in a
dynamic version of MoltenVK.xcframework.
- Use Xcode to directly generate a MoltenVK.framework for each platform,
and remove create_dylib*.sh scripts.
- Move static XCFramework, containing libMoltenVK.a static libraries,
to Package/Latest/MoltenVK/static/MoltenVK.xcframework.
- Generate dynamic XCFramework, containing MoltenVK.framework dynamic
libraries, in Package/Latest/MoltenVK/dynamic/MoltenVK.xcframework.
- Add macro MVK_VERSION_STRING to create version string at compile time,
use it to validate the CURRENT_PROJECT_VERSION build setting at compile time,
and use it at runtime instead of mvkGetMoltenVKVersionString() function.
- Add -w to OTHER_LDFLAGS to dynamic framework builds to suppress
spurious linker warnings of the type
"ld: warning: no platform load command found in '...', assuming: iOS"
issued from the new linker introduced in Xcode 15.
- Add MoltenVK-MacCat Xcode target and MoltenVK Package (MacCat only)
Xcode scheme to avoid building dynamic MoltenVK.framework for the
Mac Catalyst platform, because Xcode does not support doing so.
- Always run MoltenVK build scripts, to ensure all components are
added to the XCFrameworks, and MoltenVK/Package is always refreshed,
even if code compilation is not required.
- Cube demo link to dynamic MoltenVK.framework through
dynamic/MoltenVK.xcframework, instead of to naked libMoltenVK.dylib.
- Update the version of Volk used by the Cube demo, to support
loading MoltenVK from dynamic frameworks inside Volk.
- Update README.md and MoltenVK_Runtime_UserGuide.md documents.
- Update MVK_PRIVATE_API_VERSION to 40.
- Fix make install to install /usr/local/lib/libMoltenVK.dylib on macOS (unrelated).
- Remove unused MTLAttributeStrideStatic declaration prior to Xcode 15 (unrelated).
2024-02-29 22:03:44 -05:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (MacCat only)" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration "Debug" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
2020-11-30 18:52:34 -05:00
|
|
|
|
2020-06-09 14:30:46 -07:00
|
|
|
.PHONY: tvos
|
|
|
|
tvos:
|
2022-09-30 00:17:27 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -destination "generic/platform=tvOS" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
2020-06-23 16:08:00 -04:00
|
|
|
|
|
|
|
.PHONY: tvos-debug
|
|
|
|
tvos-debug:
|
2022-09-30 00:17:27 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -destination "generic/platform=tvOS" -configuration "Debug" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
2020-06-09 14:30:46 -07:00
|
|
|
|
2020-09-01 14:39:46 -04:00
|
|
|
.PHONY: tvossim
|
|
|
|
tvossim:
|
2022-09-30 00:17:27 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -destination "generic/platform=tvOS Simulator" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
2020-06-23 16:08:00 -04:00
|
|
|
|
2020-09-01 14:39:46 -04:00
|
|
|
.PHONY: tvossim-debug
|
|
|
|
tvossim-debug:
|
2022-09-30 00:17:27 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -destination "generic/platform=tvOS Simulator" -configuration "Debug" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
2020-06-22 15:56:22 -04:00
|
|
|
|
2023-06-23 10:24:35 -04:00
|
|
|
.PHONY: visionos
|
|
|
|
visionos:
|
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (visionOS only)" -destination "generic/platform=xrOS" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
|
|
|
|
|
|
|
.PHONY: visionos-debug
|
|
|
|
visionos-debug:
|
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (visionOS only)" -destination "generic/platform=xrOS" -configuration "Debug" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
|
|
|
|
|
|
|
.PHONY: visionossim
|
|
|
|
visionossim:
|
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (visionOS only)" -destination "generic/platform=xrOS Simulator" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
|
|
|
|
|
|
|
.PHONY: visionossim-debug
|
|
|
|
visionossim-debug:
|
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (visionOS only)" -destination "generic/platform=xrOS Simulator" -configuration "Debug" GCC_PREPROCESSOR_DEFINITIONS='$${inherited} $(MAKEARGS)' $(OUTPUT_FMT_CMD)
|
|
|
|
|
2018-10-30 23:16:12 -04:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2021-06-14 19:59:33 -04:00
|
|
|
$(XCODEBUILD) clean -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (macOS only)" -destination "generic/platform=macOS" $(OUTPUT_FMT_CMD)
|
2018-10-30 23:16:12 -04:00
|
|
|
rm -rf Package
|
|
|
|
|
2020-06-22 15:56:22 -04:00
|
|
|
# Usually requires 'sudo make install'
|
2019-03-22 19:36:21 -04:00
|
|
|
.PHONY: install
|
|
|
|
install:
|
Improve support for iOS App Store rules by using dynamic XCFramework.
Apple's iOS App Store does not permit an app to link to naked dylibs.
Instead, these must be placed in frameworks, which are embedded in a
dynamic version of MoltenVK.xcframework.
- Use Xcode to directly generate a MoltenVK.framework for each platform,
and remove create_dylib*.sh scripts.
- Move static XCFramework, containing libMoltenVK.a static libraries,
to Package/Latest/MoltenVK/static/MoltenVK.xcframework.
- Generate dynamic XCFramework, containing MoltenVK.framework dynamic
libraries, in Package/Latest/MoltenVK/dynamic/MoltenVK.xcframework.
- Add macro MVK_VERSION_STRING to create version string at compile time,
use it to validate the CURRENT_PROJECT_VERSION build setting at compile time,
and use it at runtime instead of mvkGetMoltenVKVersionString() function.
- Add -w to OTHER_LDFLAGS to dynamic framework builds to suppress
spurious linker warnings of the type
"ld: warning: no platform load command found in '...', assuming: iOS"
issued from the new linker introduced in Xcode 15.
- Add MoltenVK-MacCat Xcode target and MoltenVK Package (MacCat only)
Xcode scheme to avoid building dynamic MoltenVK.framework for the
Mac Catalyst platform, because Xcode does not support doing so.
- Always run MoltenVK build scripts, to ensure all components are
added to the XCFrameworks, and MoltenVK/Package is always refreshed,
even if code compilation is not required.
- Cube demo link to dynamic MoltenVK.framework through
dynamic/MoltenVK.xcframework, instead of to naked libMoltenVK.dylib.
- Update the version of Volk used by the Cube demo, to support
loading MoltenVK from dynamic frameworks inside Volk.
- Update README.md and MoltenVK_Runtime_UserGuide.md documents.
- Update MVK_PRIVATE_API_VERSION to 40.
- Fix make install to install /usr/local/lib/libMoltenVK.dylib on macOS (unrelated).
- Remove unused MTLAttributeStrideStatic declaration prior to Xcode 15 (unrelated).
2024-02-29 22:03:44 -05:00
|
|
|
$ rm -f /usr/local/lib/libMoltenVK.dylib
|
|
|
|
$ cp -p Package/Latest/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib /usr/local/lib
|