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
swift build と Xcode での Build の違い
Search
Toshihiro Morimoto
June 27, 2016
Technology
3
2k
swift build と Xcode での Build の違い
Tokyo Server-Side Swift Meetup #4
Toshihiro Morimoto
June 27, 2016
Tweet
Share
More Decks by Toshihiro Morimoto
See All by Toshihiro Morimoto
Xcode8 で開発はどうかわったのか
dealforest
10
5.8k
魅せるデバッグ技術
dealforest
4
1.5k
LLDB の世界からみた Swift
dealforest
4
4.9k
Xcode で快適なデバッグライフを追い求める
dealforest
29
22k
Intrducing debug in WWDC2016
dealforest
3
750
RIP Xcode Plugin 🙏
dealforest
0
4.7k
Introducing Xcode Editor Extension
dealforest
2
4.5k
Introducing Anglerfish
dealforest
2
3.2k
音声ガイダンスを導入した話
dealforest
0
3.8k
Other Decks in Technology
See All in Technology
GitHub Universe: Evaluating RAG apps in GitHub Actions
pamelafox
0
170
君は隠しイベントを見つけれるか?
mujyun
0
290
スプリントゴールにチームの状態も設定する背景とその効果 / Team state in sprint goals why and impact
kakehashi
2
100
Figma Dev Modeで進化するデザインとエンジニアリングの協働 / figma-with-engineering
cyberagentdevelopers
PRO
1
430
新卒1年目が向き合う生成AI事業の開発を加速させる技術選定 / ai-web-launcher
cyberagentdevelopers
PRO
7
1.5k
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
290k
使えそうで使われないCloudHSM
maikamibayashi
0
170
Jr. Championsになって、強く連携しながらAWSをもっと使いたい!~AWSに対する期待と行動~
amixedcolor
0
190
よくわからんサービスについての問い合わせが来たときの強い味方 Amazon Q について
kazzpapa3
0
220
ガバメントクラウド先行事業中間報告を読み解く
sugiim
1
1.3k
分布で見る効果検証入門 / ai-distributional-effect
cyberagentdevelopers
PRO
4
700
【技術書典17】OpenFOAM(自宅で極める流体解析)2次元円柱まわりの流れ
kamakiri1225
0
210
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
115
6.9k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
3
370
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
7.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
107
49k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
228
52k
Happy Clients
brianwarren
97
6.7k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Designing the Hi-DPI Web
ddemaree
280
34k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Building Your Own Lightsaber
phodgson
102
6k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Transcript
swift build ͱ Xcode Ͱͷ Build ͷҧ͍ 2016/06/27 Tokyo Server-Side
Swift Meetup #4 @dealforest Toshihro Morimoto
ࣗݾհ
None
ࠓ͓͢͠Δ͜ͱ 1. Slimane Λ Build Ͱ͖ΔΑ͏ʹͳΔ·Ͱ 2. swift build ͱ
Xcode Ͱͷ Build ͷҧ͍
1. Slimane Λ Build Ͱ͖ΔΑ͏ʹͳΔ·Ͱ
None
Slimane express ϥΠΫͳ server side swift framework Ͱ͢
׆ൃʹ։ൃ͞Ε͍ͯ·͢
ͱΓ͋͑ͣ Terminal ͔Βͱ Xcode ͔Β Build Ͱ͖ΔΑ͏ʹ͠·ͨ͠
ͦͷաఔΛͲ͏ͧ
ઌʹݴ͓ͬͯ͘ͱ slimane-cli ͔Β࡞ͬͨϓϩδΣΫτ ͩͱ Build Ͱ͖·ͤΜͰͨ͠
ࠓͳ͓ͬͨΈ͍ͨͰ͢ 2016/06/27 18:00
https://github.com/noppoMan/Slimane/wiki/Install-Guide
ࣄલ४උ • DEVELOPMENT-SNAPSHOT-2016-05-31-a ΛΠϯετʔϧ (commit ʹΑͬͯมΘΓ·͢) $ brew install libuv
openssl hiredis $ brew link libuv --force $ brew link openssl --force $ brew link -f hiredis
αʔόʔΛىಈ $ git clone https://github.com/noppoMan/Slimane-Fullstack $ cd Slimane-Fullstack $ make
debug $ ./.build/debug/Example Slimane server is listening at 0.0.0.0:3000
֬ೝ $ curl http://localhost:3000 Welcome to Slimane!
Terminal ͔Β؆୯Ͱ͢Ͷ
࣍ Xcode ͰϏϧυͯ͠Έ·͠ΐ͏
swift package generate-xcodeproj
͜ΕΛ࣮ߦ͢Δͱ Xcode ͷϓϩδΣΫτ͕࡞ΒΕ·͢
Xcode Ͱ SlimaneFullstack Λ։͘ $ swift package generate-xcodeproj $ open
SlimaneFullstack.xcodeproj
ҙࣄ߲ͱͯ͠ Xcode 7.3.1 Ͱ͋Δඞཁ͕͋Γ·͢
ҙࣄ߲ͱͯ͠ Xcode 7.3.1 Ͱ͋Δඞཁ͕͋Γ·͢
ʂʂʂʂʂʂʂʂʂ
ͳΜͱͦͷ··Ͱ Build Ͱ͖·ͤΜ
൵͍͠Ͱ͢Ͷ
ͱ͍͏Θ͚Ͱ ย͔ͬΒΤϥʔΛ௵͍͖ͯ͠·͢
Xcode Ͱ Build Ͱ͖ΔΑ͏ʹͳΔ·Ͱ 1. 'uv.h' file not found 2.
ld: library not found for -luv for architecture x86_64 3. ld: library not found for -lCURIParser for architecture x86_64
1. 'uv.h' file not found ͜Εઌ΄Ͳ Homebrew ͰೖΕͨϥΠϒϥϦͷ ϔομʔ͕ݟ͔ͭΒͳ͍ͷ͕ݪҼͰ͢
Header Search Paths ʹ /usr/local/include ΛՃ
2. ld: library not found for -luv for architecture x86_64
͜Εઌ΄Ͳ Homebrew ͰೖΕͨϥΠϒϥϦͷ dynamic library ͕ݟ͔ͭΒͳ͍ͷ͕ݪҼͰ͢
Library Search Paths ʹ /usr/local/lib ΛՃ
3. ld: library not found for -lCURIParser for architecture x86_64
͜Ε SPM Ͱґଘ͍ͯ͠ΔϥΠϒϥϦʹؚ·ΕΔ dylib ͕Ϗϧυ࣌ʹղܾͰ͖ͳ͍ͷ͕ݪҼͰ͢
3. ld: library not found for -lCURIParser for architecture x86_64
ͪΌΜͱղܾ͕࣌ؒͳ͔ͬͨͷͰɹɹɹɹɹɹɹ ఆରԠͱͳΓ·͢ Ұ swift build Λ࣮ߦ͓ͯ͘͠ඞཁ͕͋Γ·͢ (slimane Ͱ͍͏ make debug ͷ͜ͱͰ͢)
Library Search Paths ʹ $(SRCROOT)/.build/debug ΛՃ
͜ΕͰΊͰͨ͘ Build Ͱ͖ΔΑ͏ʹͳΓ·ͨ͠
ΊΜͲ͍͘͞Ͱ͢Ͷ
Ͳ͏ͯ͜͠ͷΑ͏ͳ͕ࠩ ͰΔͷ͔ݟ͍͖ͯ·͠ΐ͏
2. swift build ͱ Xcode Ͱͷ Build ͷҧ͍
swift build • ࣮ߦόΠφϦΛࣗͰ࣮ߦ (./.build/debug/Example) • $(SRC_ROOT)/.build ԼʹதؒϑΝΠϧ͕Ͱ͖Δ • ґଘϥΠϒϥϦ
swiftc ͰίϯύΠϧ͠ -emit-executable Ͱ link ͍ͯ͠Δ
Xcode • Xcode Ͱ target Λબ͍ͯ Run Ͱ࣮ߦ • DerivedData
ԼʹதؒϑΝΠϧ͕Ͱ͖Δ • ґଘϥΠϒϥϦ dynamic framework Ͱ link ͍ͯ͠Δ • xcodebuild Ͱͬͯಉ͡ (CONFIGURATION_BUILD_DIRಈ͘) xcodebuild build -project "SlimaneFullstack.xcodeproj" ɹɹ-scheme "Example" -configuration Debug ɹ ɹɹ-sdk macosx10.11 CONFIGURATION_BUILD_DIR=build
so ͱ dylib ͱ framework ٛͰಉ͡ (ͨͿΜ…)
/Applications/Xcode-7.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode-7.3.1.app/Contents/Developer/Platforms/MacOSX.platform/ Developer/SDKs/MacOSX10.11.sdk -L/Users/dealforest/Library/Developer/Xcode/DerivedData/ SlimaneFullstack-bahaftgmcprmzfgeqgmkpxlvnuog/Build/Products/Debug -F/Users/dealforest/Library/Developer/
Xcode/DerivedData/SlimaneFullstack-bahaftgmcprmzfgeqgmkpxlvnuog/Build/Products/Debug -filelist /Users/ dealforest/Library/Developer/Xcode/DerivedData/SlimaneFullstack-bahaftgmcprmzfgeqgmkpxlvnuog/Build/ Intermediates/SlimaneFullstack.build/Debug/URI.build/Objects-normal/x86_64/URI.LinkFileList -install_name @rpath/URI.framework/Versions/A/URI -Xlinker -rpath -Xlinker /Library/Developer/Toolchains/swift- DEVELOPMENT-SNAPSHOT-2016-05-31-a.xctoolchain/usr/lib/swift/macosx -mmacosx-version-min=10.10 - fobjc-link-runtime -L/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-05-31- a.xctoolchain/usr/lib/swift/macosx -Xlinker -add_ast_path -Xlinker /Users/dealforest/Library/Developer/Xcode/ DerivedData/SlimaneFullstack-bahaftgmcprmzfgeqgmkpxlvnuog/Build/Intermediates/SlimaneFullstack.build/ Debug/URI.build/Objects-normal/x86_64/URI.swiftmodule -framework C7 -framework CURIParser -framework String -single_module -Xlinker -dependency_info -Xlinker /Users/ dealforest/Library/Developer/Xcode/DerivedData/SlimaneFullstack-bahaftgmcprmzfgeqgmkpxlvnuog/Build/ Intermediates/SlimaneFullstack.build/Debug/URI.build/Objects-normal/x86_64/URI_dependency_info.dat -o / Users/dealforest/Library/Developer/Xcode/DerivedData/SlimaneFullstack-bahaftgmcprmzfgeqgmkpxlvnuog/ Build/Products/Debug/URI.framework/Versions/A/URI
ld: library not found for -lCURIParser for architecture x86_64
Ͳ͏ͯ͠ -framework Ͱ link ͠Α͏ͱ ͍ͯ͠Δͷʹ -l Λ͢Δͷ͔
dylib ͱ framework ͕བྷΉͱ Ͳ͏͏·͍͜ͱ͍͔ͳ͍Έ͍ͨ
͔Δਓ͕͍Εڭ͍͑ͯͩ͘͞
Ұॹʹߟ͑·͠ΐ͏
·ͱΊ ෳࡶͳґଘΛղܾ͢Δ߹ swift build Λૉ ʹͬͯ Build ͨ͠΄͏͕ͤʹͳΕ·͢ Xcode Ͱ͍͍ͬͯͰ͕͢ཕଟ͍Ͱ͢
·ͱΊ swift package generate-xcodeproj ͕ ݡ͘ͳΔͷΛ͔ͭ PR ૹΓ·͠ΐ͏
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠