Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 1576953

Browse files
committed
[osx] Moved SDK from gyp into Xcode project
Added a new Cocoa dynamic framework target target to the main OS X Xcode project. The target is based on the template provided by Xcode. It contains headers and source files in the darwin/ and osx/ subdirectories. Headers are explicitly marked public or project-internal instead of implicitly by subdirectory. Removed the osxsdk target from platform.gypi. The SDK target has a few dependencies that are managed by mason. Transform the config.gypi generated by configure into an .xcconfig file that Xcode uses to fill in compiler and linker flags. Added a CI scheme that builds the All aggregate target generated by gyp and the osxapp and SDK test targets.
1 parent 7054f80 commit 1576953

File tree

7 files changed

+860
-199
lines changed

7 files changed

+860
-199
lines changed

Makefile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,25 @@ OSX_PROJ_PATH = build/osx-x86_64/platform/osx/platform.xcodeproj
2020
OSX_WORK_PATH = platform/osx/osx.xcworkspace
2121
OSX_DERIVED_DATA_PATH = build/DerivedData/osx
2222

23-
osx:
24-
$(RUN) PLATFORM=osx Xcode/All
25-
2623
$(OSX_PROJ_PATH): platform/osx/platform.gyp platform/osx/scripts/configure.sh mbgl.gypi test/test.gypi bin/*.gypi
2724
$(RUN) PLATFORM=osx Xcode/__project__
2825

26+
osx: $(OSX_PROJ_PATH)
27+
set -o pipefail && xcodebuild \
28+
-derivedDataPath $(OSX_DERIVED_DATA_PATH) \
29+
-configuration $(BUILDTYPE) \
30+
-workspace $(OSX_WORK_PATH) -scheme CI build | xcpretty
31+
2932
xproj: $(OSX_PROJ_PATH)
3033
open $(OSX_WORK_PATH)
3134

32-
$(OSX_PROJ_PATH)/xcshareddata/xcschemes/osxtest.xcscheme: platform/osx/scripts/osxtest.xcscheme
33-
mkdir -p $(basename $@)
34-
cp $< $@
35-
36-
test-osx: $(OSX_PROJ_PATH) $(OSX_PROJ_PATH)/xcshareddata/xcschemes/osxtest.xcscheme node_modules/express
37-
set -o pipefail && xcodebuild -project $(OSX_PROJ_PATH) -configuration $(BUILDTYPE) -target test build | xcpretty
38-
ulimit -c unlimited && (build/osx-x86_64/$(BUILDTYPE)/test & pid=$$! && wait $$pid \
35+
test-osx: osx node_modules/express
36+
ulimit -c unlimited && ($(OSX_DERIVED_DATA_PATH)/Build/Products/$(BUILDTYPE)/test & pid=$$! && wait $$pid \
3937
|| (lldb -c /cores/core.$$pid --batch --one-line 'thread backtrace all' --one-line 'quit' && exit 1))
40-
set -o pipefail && xcodebuild -project $(OSX_PROJ_PATH) -configuration $(BUILDTYPE) -scheme osxtest test | xcpretty
38+
set -o pipefail && xcodebuild \
39+
-derivedDataPath $(OSX_DERIVED_DATA_PATH) \
40+
-configuration $(BUILDTYPE) \
41+
-workspace $(OSX_WORK_PATH) -scheme CI test | xcpretty
4142

4243
#### iOS targets ##############################################################
4344

platform/osx/DEVELOPING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The Mapbox OS X SDK and the osxapp demo application run on OS X 10.10.0 and abov
1010

1111
1. [Install core dependencies](../../INSTALL.md).
1212
1. Run `make xproj`.
13-
1. Switch to the osxsdk or osxapp scheme. The former builds just the Cocoa framework, while the latter also builds a Cocoa demo application based on it.
13+
1. Switch to the dynamic or osxapp scheme. The former builds just the Cocoa framework, while the latter also builds a Cocoa demo application based on it.
1414

1515
### Access tokens
1616

platform/osx/osx.xcodeproj/project.pbxproj

Lines changed: 601 additions & 8 deletions
Large diffs are not rendered by default.
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0730"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "4E8A9455A3A23B7FD2A8FC52"
18+
BuildableName = "All"
19+
BlueprintName = "All"
20+
ReferencedContainer = "container:../../build/osx-x86_64/platform/osx/platform.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "YES"
27+
buildForArchiving = "YES"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "DA839E911CC2E3400062CAFB"
32+
BuildableName = "Mapbox GL.app"
33+
BlueprintName = "osxapp"
34+
ReferencedContainer = "container:osx.xcodeproj">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
<BuildActionEntry
38+
buildForTesting = "YES"
39+
buildForRunning = "NO"
40+
buildForProfiling = "NO"
41+
buildForArchiving = "NO"
42+
buildForAnalyzing = "NO">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "DAE6C3301CC30DB200DB3429"
46+
BuildableName = "test.xctest"
47+
BlueprintName = "test"
48+
ReferencedContainer = "container:osx.xcodeproj">
49+
</BuildableReference>
50+
</BuildActionEntry>
51+
</BuildActionEntries>
52+
</BuildAction>
53+
<TestAction
54+
buildConfiguration = "Debug"
55+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
56+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
57+
shouldUseLaunchSchemeArgsEnv = "YES">
58+
<Testables>
59+
<TestableReference
60+
skipped = "NO">
61+
<BuildableReference
62+
BuildableIdentifier = "primary"
63+
BlueprintIdentifier = "DAE6C3301CC30DB200DB3429"
64+
BuildableName = "test.xctest"
65+
BlueprintName = "test"
66+
ReferencedContainer = "container:osx.xcodeproj">
67+
</BuildableReference>
68+
</TestableReference>
69+
</Testables>
70+
<MacroExpansion>
71+
<BuildableReference
72+
BuildableIdentifier = "primary"
73+
BlueprintIdentifier = "DA839E911CC2E3400062CAFB"
74+
BuildableName = "Mapbox GL.app"
75+
BlueprintName = "osxapp"
76+
ReferencedContainer = "container:osx.xcodeproj">
77+
</BuildableReference>
78+
</MacroExpansion>
79+
<AdditionalOptions>
80+
</AdditionalOptions>
81+
</TestAction>
82+
<LaunchAction
83+
buildConfiguration = "Debug"
84+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
85+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
86+
launchStyle = "0"
87+
useCustomWorkingDirectory = "NO"
88+
ignoresPersistentStateOnLaunch = "NO"
89+
debugDocumentVersioning = "YES"
90+
debugServiceExtension = "internal"
91+
allowLocationSimulation = "YES">
92+
<MacroExpansion>
93+
<BuildableReference
94+
BuildableIdentifier = "primary"
95+
BlueprintIdentifier = "DA839E911CC2E3400062CAFB"
96+
BuildableName = "Mapbox GL.app"
97+
BlueprintName = "osxapp"
98+
ReferencedContainer = "container:osx.xcodeproj">
99+
</BuildableReference>
100+
</MacroExpansion>
101+
<AdditionalOptions>
102+
</AdditionalOptions>
103+
</LaunchAction>
104+
<ProfileAction
105+
buildConfiguration = "Release"
106+
shouldUseLaunchSchemeArgsEnv = "YES"
107+
savedToolIdentifier = ""
108+
useCustomWorkingDirectory = "NO"
109+
debugDocumentVersioning = "YES">
110+
<BuildableProductRunnable
111+
runnableDebuggingMode = "0">
112+
<BuildableReference
113+
BuildableIdentifier = "primary"
114+
BlueprintIdentifier = "DA839E911CC2E3400062CAFB"
115+
BuildableName = "Mapbox GL.app"
116+
BlueprintName = "osxapp"
117+
ReferencedContainer = "container:osx.xcodeproj">
118+
</BuildableReference>
119+
</BuildableProductRunnable>
120+
</ProfileAction>
121+
<AnalyzeAction
122+
buildConfiguration = "Debug">
123+
</AnalyzeAction>
124+
<ArchiveAction
125+
buildConfiguration = "Release"
126+
revealArchiveInOrganizer = "YES">
127+
</ArchiveAction>
128+
</Scheme>
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0730"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "DAE6C3271CC30DB200DB3429"
18+
BuildableName = "Mapbox.framework"
19+
BlueprintName = "dynamic"
20+
ReferencedContainer = "container:osx.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "NO"
26+
buildForProfiling = "NO"
27+
buildForArchiving = "NO"
28+
buildForAnalyzing = "NO">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "DAE6C3301CC30DB200DB3429"
32+
BuildableName = "test.xctest"
33+
BlueprintName = "test"
34+
ReferencedContainer = "container:osx.xcodeproj">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
</BuildActionEntries>
38+
</BuildAction>
39+
<TestAction
40+
buildConfiguration = "Debug"
41+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
42+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43+
shouldUseLaunchSchemeArgsEnv = "YES">
44+
<Testables>
45+
<TestableReference
46+
skipped = "NO">
47+
<BuildableReference
48+
BuildableIdentifier = "primary"
49+
BlueprintIdentifier = "DAE6C3301CC30DB200DB3429"
50+
BuildableName = "test.xctest"
51+
BlueprintName = "test"
52+
ReferencedContainer = "container:osx.xcodeproj">
53+
</BuildableReference>
54+
</TestableReference>
55+
</Testables>
56+
<MacroExpansion>
57+
<BuildableReference
58+
BuildableIdentifier = "primary"
59+
BlueprintIdentifier = "DAE6C3271CC30DB200DB3429"
60+
BuildableName = "Mapbox.framework"
61+
BlueprintName = "dynamic"
62+
ReferencedContainer = "container:osx.xcodeproj">
63+
</BuildableReference>
64+
</MacroExpansion>
65+
<AdditionalOptions>
66+
</AdditionalOptions>
67+
</TestAction>
68+
<LaunchAction
69+
buildConfiguration = "Debug"
70+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
71+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
72+
launchStyle = "0"
73+
useCustomWorkingDirectory = "NO"
74+
ignoresPersistentStateOnLaunch = "NO"
75+
debugDocumentVersioning = "YES"
76+
debugServiceExtension = "internal"
77+
allowLocationSimulation = "YES">
78+
<MacroExpansion>
79+
<BuildableReference
80+
BuildableIdentifier = "primary"
81+
BlueprintIdentifier = "DAE6C3271CC30DB200DB3429"
82+
BuildableName = "Mapbox.framework"
83+
BlueprintName = "dynamic"
84+
ReferencedContainer = "container:osx.xcodeproj">
85+
</BuildableReference>
86+
</MacroExpansion>
87+
<AdditionalOptions>
88+
</AdditionalOptions>
89+
</LaunchAction>
90+
<ProfileAction
91+
buildConfiguration = "Release"
92+
shouldUseLaunchSchemeArgsEnv = "YES"
93+
savedToolIdentifier = ""
94+
useCustomWorkingDirectory = "NO"
95+
debugDocumentVersioning = "YES">
96+
<MacroExpansion>
97+
<BuildableReference
98+
BuildableIdentifier = "primary"
99+
BlueprintIdentifier = "DAE6C3271CC30DB200DB3429"
100+
BuildableName = "Mapbox.framework"
101+
BlueprintName = "dynamic"
102+
ReferencedContainer = "container:osx.xcodeproj">
103+
</BuildableReference>
104+
</MacroExpansion>
105+
</ProfileAction>
106+
<AnalyzeAction
107+
buildConfiguration = "Debug">
108+
</AnalyzeAction>
109+
<ArchiveAction
110+
buildConfiguration = "Release"
111+
revealArchiveInOrganizer = "YES">
112+
</ArchiveAction>
113+
</Scheme>

0 commit comments

Comments
 (0)