2016-09-29 38 views
0

我想彙編寫在新雨燕軟件包管理器格式轉換成高度優化的二進制代碼,我迅速的代碼來構建斯威夫特包的優化版本。這可能是目前使用swiftc -O somefile.swift但由於迅速的軟件包將使用swift build命令建成,我無法通過-O選擇,因爲它不接受它。那麼是否有一種方法可以在編譯過程中指定優化代碼? swift build --configuration release如何使用雨燕的軟件包管理器`迅速build`命令

回答

1

您可以在發佈配置與構建。

$ swift build --help 
OVERVIEW: Build sources into binary products 

USAGE: swift build [mode] [options] 

MODES: 
    -c, --configuration <value> Build with configuration (debug|release) [default: debug] 
    --clean [<mode>]    Delete artifacts (build|dist) [default: build] 

OPTIONS: 
     -C, --chdir <path>  Change working directory before any other operation 
    --build-path <path>  Specify build/cache directory [default: ./.build] 
    --color <mode>   Specify color mode (auto|always|never) [default: auto] 
    -v, --verbose   Increase verbosity of informational output 
    -Xcc <flag>    Pass flag through to all C compiler invocations 
    -Xlinker <flag>   Pass flag through to all linker invocations 
    -Xswiftc <flag>   Pass flag through to all Swift compiler invocations 

NOTE: Use `swift package` to perform other functions on packages 

其中列出了此選項:

您還可以通過看到該工具的使用。

見包管理器reference以獲取更多信息。

+0

感謝您的信息。之所以能夠通過運行以下命令'迅速構建-Xswiftc -O'通過優化選項 –