Skip to content

Commit

Permalink
Fix issue where incremental dynamic builds do not link to static depe…
Browse files Browse the repository at this point in the history
…ndencies.

After the recent change to building dynamic frameworks and dylibs as targets
built by linking to a static library dependency, incremental builds do not
correctly link the dynamic frameworks and dylibs to the rebuilt static library.

- Delete dynamic target outputs during static target builds.
- Run platform schemes sequentially in manual order.
- Build the dynamic framework before the dylib.
- Clean up Xcode Scheme organization.

It is not entirely obvious what the dependency problem is, and why
these particular changes work. A lot of trial-and-error was required.
It's possible that Xcode dependency analysis does not correctly analyze
the flow used in MoltenVK builds.
  • Loading branch information
billhollings committed Mar 30, 2024
1 parent e97ec49 commit 7533974
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 315 deletions.
84 changes: 84 additions & 0 deletions MoltenVK/MoltenVK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,7 @@
2FEA0A4024902F9F00EEF3AD /* Headers */,
2FEA0A8224902F9F00EEF3AD /* Sources */,
A9CBBFF124F89F79006D41EF /* Copy to Staging */,
A905CE712BB898E000BBCB10 /* Clean Dynamic */,
);
buildRules = (
);
Expand Down Expand Up @@ -1556,6 +1557,7 @@
A9B8EE071A98D796009C5A02 /* Headers */,
A9B8EE051A98D796009C5A02 /* Sources */,
A9CBBFEF24F89F5F006D41EF /* Copy to Staging */,
A905CE702BB8988A00BBCB10 /* Clean Dynamic */,
);
buildRules = (
);
Expand All @@ -1575,6 +1577,7 @@
A9CBED871B6299D800E45FDC /* Headers */,
A9CBEDCE1B6299D800E45FDC /* Sources */,
A9CBBFF224F89F87006D41EF /* Copy to Staging */,
A942D3052BAC3AD200A25A0A /* Clean Dynamic */,
);
buildRules = (
);
Expand Down Expand Up @@ -1674,6 +1677,7 @@
DCFD7EE32A45BC6E007BBBF7 /* Headers */,
DCFD7F272A45BC6E007BBBF7 /* Sources */,
DCFD7F5D2A45BC6E007BBBF7 /* Copy to Staging */,
A905CE722BB8993F00BBCB10 /* Clean Dynamic */,
);
buildRules = (
);
Expand Down Expand Up @@ -1811,6 +1815,86 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
A905CE702BB8988A00BBCB10 /* Clean Dynamic */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/libMoltenVK.a",
);
name = "Clean Dynamic";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CleanDynamicDummyOutputFile",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = ". \"${SRCROOT}/../Scripts/clean_dynamic.sh\"\n";
};
A905CE712BB898E000BBCB10 /* Clean Dynamic */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/libMoltenVK.a",
);
name = "Clean Dynamic";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CleanDynamicDummyOutputFile",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = ". \"${SRCROOT}/../Scripts/clean_dynamic.sh\"\n";
};
A905CE722BB8993F00BBCB10 /* Clean Dynamic */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/libMoltenVK.a",
);
name = "Clean Dynamic";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CleanDynamicDummyOutputFile",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = ". \"${SRCROOT}/../Scripts/clean_dynamic.sh\"\n";
};
A942D3052BAC3AD200A25A0A /* Clean Dynamic */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${BUILT_PRODUCTS_DIR}/libMoltenVK.a",
);
name = "Clean Dynamic";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/$(TARGET_NAME)/CleanDynamicDummyOutputFile",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = ". \"${SRCROOT}/../Scripts/clean_dynamic.sh\"\n";
};
A980A25B24C6283D007A8F6F /* Generate Version Header */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
8 changes: 5 additions & 3 deletions MoltenVKPackaging.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
A975D59A2140586700D4834F /* Package MoltenVK */,
);
dependencies = (
A979A95A2B9A232800F69E67 /* PBXTargetDependency */,
A9F4D9F12B8EC210004AD576 /* PBXTargetDependency */,
A979A95A2B9A232800F69E67 /* PBXTargetDependency */,
);
name = "MoltenVK-macOS";
productName = Package;
Expand All @@ -75,8 +75,8 @@
A9B1008824F84BE400EADC6E /* Package MoltenVK */,
);
dependencies = (
A979A9662B9A233C00F69E67 /* PBXTargetDependency */,
A9F4D9F82B8EC22E004AD576 /* PBXTargetDependency */,
A979A9662B9A233C00F69E67 /* PBXTargetDependency */,
A9F4D9F62B8EC22E004AD576 /* PBXTargetDependency */,
A9F4D9FA2B8EC22E004AD576 /* PBXTargetDependency */,
);
Expand Down Expand Up @@ -276,6 +276,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
A905CE6F2BB897F700BBCB10 /* clean_dynamic.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = clean_dynamic.sh; sourceTree = "<group>"; };
A92DB3E41CE0F37D00FBC835 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
A92DB3E51CE0F37D00FBC835 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
A92DB3E61CE0F37D00FBC835 /* Whats_New.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = Whats_New.md; path = Docs/Whats_New.md; sourceTree = "<group>"; };
Expand Down Expand Up @@ -346,6 +347,7 @@
A975D55B213F25AD00D4834F /* Scripts */ = {
isa = PBXGroup;
children = (
A905CE6F2BB897F700BBCB10 /* clean_dynamic.sh */,
A9F4D8942B8D4F81004AD576 /* copy_to_staging.sh */,
A93ED4DE24F59CDB00FEB018 /* copy_lib_to_staging.sh */,
A9B1007A24F837AF00EADC6E /* create_xcframework_func.sh */,
Expand Down Expand Up @@ -430,9 +432,9 @@
projectRoot = "";
targets = (
A9FEADBC1F3517480010240E /* MoltenVK */,
A975D58B2140586700D4834F /* MoltenVK-macOS */,
A975D5782140585200D4834F /* MoltenVK-iOS */,
2FEA0A2F24902F5E00EEF3AD /* MoltenVK-tvOS */,
A975D58B2140586700D4834F /* MoltenVK-macOS */,
DCFD7ED52A45BC56007BBBF7 /* MoltenVK-xrOS */,
A91170FD2B9110050057AD37 /* MoltenVK-MacCat */,
A9AD700D2440ED3B00B9E254 /* MVKShaderConverterTool */,
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
LastUpgradeVersion = "9999"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
parallelizeBuildables = "NO"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
LastUpgradeVersion = "9999"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
parallelizeBuildables = "NO"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
LastUpgradeVersion = "9999"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
parallelizeBuildables = "NO"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
LastUpgradeVersion = "9999"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
parallelizeBuildables = "NO"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
LastUpgradeVersion = "9999"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
parallelizeBuildables = "NO"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
version = "2.0">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
Loading

0 comments on commit 7533974

Please sign in to comment.