fetchDependencies supports iOS simulator fat external library builds.

fetchDependencies supports options for specifying which platform options to build for.
Fix SPIRV-Tools builds to avoid code stripping warnings.
This commit is contained in:
Bill Hollings 2020-06-17 19:10:33 -04:00
parent 491698e49d
commit 50828dde93
3 changed files with 97 additions and 14 deletions

View File

@ -3833,7 +3833,6 @@
A972A80D21CECBBF0013AB25 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEPLOYMENT_POSTPROCESSING = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
@ -3850,7 +3849,6 @@
A972A80E21CECBBF0013AB25 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEPLOYMENT_POSTPROCESSING = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
@ -3867,7 +3865,6 @@
A972A82121CECBE90013AB25 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEPLOYMENT_POSTPROCESSING = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
@ -3884,7 +3881,6 @@
A972A82221CECBE90013AB25 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEPLOYMENT_POSTPROCESSING = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",

View File

@ -110,7 +110,19 @@ on which **MoltenVK** relies:
3. Retrieve and build the external libraries:
cd MoltenVK
./fetchDependencies
./fetchDependencies [platform...]
When running the `fetchDependencies` script, you must specify one or more platforms
for which to build the external libraries. The platform choices include:
--ios --ios-fat --macos --all
You can specify multiple of these selections. The `--ios-fat` selection builds one binary for
each external library, with each binary including code for both *iOS* and *iOS Simulator* platforms.
The `--all` selection is the same as selecting `--ios-fat --macos` and results in two binaries
for each external library: a *fat iOS* binary, and a *macOS* binary. The more selections you include,
the longer the build time.
For more information about the external open-source libraries used by **MoltenVK**,
see the [`ExternalRevisions/README.md`](ExternalRevisions/README.md) document.

View File

@ -4,9 +4,27 @@
#
# fetchDependencies - Retrieves the correct versions of all dependencies
#
# macOS usage: ./fetchDependencies [-v] [--debug] [--build-spirv-tools]
# macOS usage: ./fetchDependencies [--ios] [--ios-fat] [--macos] [--all]
# [-v] [--debug] [--build-spirv-tools]
# [--v-headers-root path] [--spirv-cross-root path] [--glslang-root path]
#
# --ios
# Build the external libraries for the iOS platform.
#
# --ios-fat
# Build a single binary for each external library, each containing code
# for both iOS and iOS Simulator platforms.
#
# --macos
# Build the external libraries for the macOS platform.
#
# --all
# Equivalent to specifying [--ios-fat --macos]. Results in two binaries for
# each external library: one for the iOS and iOS Simulator platforms, and
# another for the macOS platform.
#
# Multiple platform options may be specified.
#
# --debug
# Build the external libraries in Debug mode, which may be useful when debugging
# and tracing calls into those libraries.
@ -41,7 +59,11 @@ set -e
# ----------------- Functions -------------------
XC_SCHEME_SFX=""
BLD_IOS=""
BLD_IOS_SIM=""
BLD_MACOS=""
BLD_SPECIFIED=""
XC_CONFIG="Release"
XC_BUILD_VERBOSITY="-quiet"
V_HEADERS_ROOT=""
SPIRV_CROSS_ROOT=""
@ -50,8 +72,31 @@ BLD_SPV_TLS=""
while (( "$#" )); do
case "$1" in
--ios)
BLD_IOS="Y"
BLD_SPECIFIED="Y"
shift 1
;;
--ios-fat)
BLD_IOS="Y"
BLD_IOS_SIM="Y"
BLD_SPECIFIED="Y"
shift 1
;;
--macos)
BLD_MACOS="Y"
BLD_SPECIFIED="Y"
shift 1
;;
--all)
BLD_IOS="Y"
BLD_IOS_SIM="Y"
BLD_MACOS="Y"
BLD_SPECIFIED="Y"
shift 1
;;
--debug)
XC_SCHEME_SFX=" (Debug)"
XC_CONFIG="Debug"
shift 1
;;
-v)
@ -85,6 +130,13 @@ while (( "$#" )); do
esac
done
# if no platform was specified, print usage message and exit
if [ "$BLD_SPECIFIED" = "" ]; then
echo ERROR: You did not specify a platform to build.
echo Include one or more of the following platform options: --ios --ios-fat --macos --all
exit 1
fi
# Update a repository. If it exists, fetch it; if not, clone it.
# $1 repo name
# $2 repo url
@ -286,17 +338,40 @@ echo
echo ========== Building dependency libraries quietly. Please be patient on first build. ==========
echo
# Build an Xcode scheme
function build() {
echo Building external libraries for ${XC_PLTFM}
xcodebuild \
-project "${XC_PROJ}" \
-scheme "${XC_SCHEME}" \
-destination "generic/platform=${XC_PLTFM}" \
-configuration "${XC_CONFIG}" \
-derivedDataPath "${XC_DD_PATH}" \
${XC_BUILD_VERBOSITY} \
build
}
EXT_DEPS=ExternalDependencies
XC_PROJ="${EXT_DEPS}.xcodeproj"
XC_SCHEME="${EXT_DEPS}${XC_SCHEME_SFX}"
XC_DD_PATH="${EXT_DIR}/build"
xcodebuild \
-project "${XC_PROJ}" \
-scheme "${XC_SCHEME}" \
-derivedDataPath "${XC_DD_PATH}" \
${XC_BUILD_VERBOSITY} \
if [ "$BLD_IOS" != "" ]; then
XC_SCHEME="${EXT_DEPS}-iOS"
XC_PLTFM="iOS"
build
fi
if [ "$BLD_IOS_SIM" != "" ]; then
XC_SCHEME="${EXT_DEPS}-iOS"
XC_PLTFM="iOS Simulator"
build
fi
if [ "$BLD_MACOS" != "" ]; then
XC_SCHEME="${EXT_DEPS}-macOS"
XC_PLTFM="macOS"
build
fi
echo ========== Done! ==========