Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Secret History: xcconfig files
Search
Renzo Crisóstomo
January 05, 2017
Programming
0
64
Secret History: xcconfig files
Slides from presentation given at CocoaHeads Hamburg January 2017 meet up.
Renzo Crisóstomo
January 05, 2017
Tweet
Share
More Decks by Renzo Crisóstomo
See All by Renzo Crisóstomo
Performance Testing using DTrace
ruenzuo
2
120
Continuous Integration in a monorepo
ruenzuo
0
500
!Introducing Swift in large code bases
ruenzuo
1
81
Scheduled Releases
ruenzuo
0
33
Other Decks in Programming
See All in Programming
Advance Your Career with Open Source
ivargrimstad
0
550
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
1.1k
Le côté obscur des IA génératives
pascallemerrer
0
150
Pull-Requestの内容を1クリックで動作確認可能にするワークフロー
natmark
2
510
Building, Deploying, and Monitoring Ruby Web Applications with Falcon (Kaigi on Rails 2025)
ioquatix
4
2.2k
そのpreloadは必要?見過ごされたpreloadが技術的負債として爆発した日
mugitti9
2
3.4k
Six and a half ridiculous things to do with Quarkus
hollycummins
0
170
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
120
AI Coding Meetup #3 - 導入セッション / ai-coding-meetup-3
izumin5210
0
3.3k
バッチ処理を「状態の記録」から「事実の記録」へ
panda728
PRO
0
160
Android16 Migration Stories ~Building a Pattern for Android OS upgrades~
reoandroider
0
110
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
160
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1371
200k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.9k
Context Engineering - Making Every Token Count
addyosmani
6
250
Faster Mobile Websites
deanohume
310
31k
Thoughts on Productivity
jonyablonski
70
4.9k
Code Reviewing Like a Champion
maltzj
526
40k
The Invisible Side of Design
smashingmag
302
51k
Building a Modern Day E-commerce SEO Strategy
aleyda
44
7.8k
Why Our Code Smells
bkeepers
PRO
340
57k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Transcript
SECRET HISTORY XCCONFIG FILES TONIGHT 8/7C XING
None
None
None
None
XCODE BUILD SYSTEM IS NOT IDEAL ! IMO !
BUT XCCONFIGS CAN HELP A LOT !
XCCONFIG > No actual documentation provided by Apple WRONG! >
Best docs provided by Samantha Marshall (holds true) > Supplemental file that replaces build settings in Xcode projects
None
None
WHAT CAN IT DO? > Override build settings > Inherit
values from existing settings: $(inherited) > Conditionally override > Import settings from other xcconfig files
OVERRIDING OTHER_LDFLAGS = -ObjC INHERIT OTHER_LDFLAGS = $(inherited) -framework Security
None
CONDITIONAL OVERRIDE > Conditions: sdk, arch, config, variant (?), dialect1
(?) GCC_PREPROCESSOR_DEFINITIONS[config=OmnitureTest] = $(inherited) OMNITURE_ENABLED=1 1 *: Google this one, you'll have a good !
INHERITANCE RULES 1. Platform defaults 2. Project file 3. xcconfig
file for the Project file 4. Target 5. xcconfig file for the target file
VALUE ASSIGNMENT RULES 1. Platform defaults 2. xcconfig file for
the Project file 3. Project file 4. xcconfig file for the target file 5. Target
VARIABLE SUBSTITUTION > String interpolation GCC_PREPROCESSOR_DEFINITIONS = $(inherited) CONFIGURATION_$(CONFIGURATION)=1 >
Resolved for Debug configuration as: GCC_PREPROCESSOR_DEFINITIONS = $(inherited) CONFIGURATION_Debug=1
PYCONFIG GET IT ON GITHUB: SAMDMARSHALL/PYCONFIG ALSO ⭐
SYNTAX export (path) !include (path) setting SETTING_NAME (inherits/use) { for/if
(condition) and (another condition) { (value) } }
EXAMPLE export "xing.xcconfig" !include "default.xcconfig" setting OTHER_LDFLAGS inherits { for
Debug { -lz, -framework "Reveal" } for Release }
RESULT #include "default.xcconfig" OTHER_LDFLAGS_Debug = $(inherited) -lz -framework "Reveal" OTHER_LDFLAGS_Release
= $(inherited) OTHER_LDFLAGS = $(inherited) $(OTHER_LDFLAGS_$(CONFIGURATION))
USE: VARIABLE SUBSTITUTION setting PRODUCT_NAME use WRAPPER_EXTENSION { for app
{ "My App" } for xctest { "Unit Test Bundle" } for bundle { "Generic Bundle" } }
RESULT PRODUCT_NAME_app = "My App" PRODUCT_NAME_xctest = "Unit Test Bundle"
PRODUCT_NAME_bundle = "Generic Bundle" PRODUCT_NAME = $(PRODUCT_NAME_$(WRAPPER_EXTENSION))
IF: CONDITIONAL ASSIGNMENT setting PRODUCT_NAME { if arch=i386 { libIntel32
} if arch=x86_64 { libIntel64 } if arch=armv7 { libArm32 } if arch=arm64 { libArm64 } }
RESULT PRODUCT_NAME[arch=i386] = libIntel32 PRODUCT_NAME[arch=x86_64] = libIntel64 PRODUCT_NAME[arch=armv7] = libArm32
PRODUCT_NAME[arch=arm64] = libArm64
DEMO
ADVANTAGES > DSL is more readable that legacy plist format
> Less changes in xcodeproj file_size = targets * configuration
DISADVANTAGES > Restart Xcode to apply xcconfig changes (! dup.)
> Migration could be some effort xcodebuild -showBuildSettings
OTHER TOOLS > jcampbell05/xcake: DSL for Xcode projects > facebook/buck:
build system used at Facebook