ios - XCode 7 自定义模板 : Change Build Settings
<p><p>我在 <a href="http://www.telerik.com/blogs/how-to-create-custom-project-templates-in-xcode-7" rel="noreferrer noopener nofollow">this</a> 之后创建自定义 <code>XCode</code> 项目模板教程。</p>
<p>我可以使用 <strong>FRAMEWORK_SEARCH_PATHS</strong> 设置build设置,但它不适用于 <strong>GCC_PREFIX_HEADER</strong> 或 <strong>LD_RUNPATH_SEARCH_PATHS</strong>。
我尝试了许多不同的解决方案,但它不适用于除 FRAMEWORK_SEARCH_PATHS 之外的任何标志。</p>
<p>如果我在这里做错了什么,请纠正我。
提前致谢!!</p>
<p>这是我到目前为止所做的。</p>
<pre><code>// Working
<key>Targets</key>
<array>
<dict>
<key>SharedSettings</key>
<dict>
<key>FRAMEWORK_SEARCH_PATHS</key>
<array>
<string>$(PROJECT_DIR)</string>
</array>
</dict>
</dict>
</array>
</code></pre>
<hr/>
<pre><code>// Not working
<key>Targets</key>
<array>
<dict>
<key>SharedSettings</key>
<dict>
<key>LD_RUNPATH_SEARCH_PATHS</key>
<array>
<string>$(inherited)</string>
<string>Users/Name/Desktop/MyFrameworkDirectory</string>
</array>
</dict>
</dict>
</array>
</code></pre>
<hr/>
<pre><code>// Not working
<key>Targets</key>
<array>
<dict>
<key>SharedSettings</key>
<dict>
<key>GCC_PRECOMPILE_PREFIX_HEADER</key>
<true/>
<key>GCC_PREFIX_HEADER</key>
<string>MyFile.pch</string>
</dict>
</dict>
</array>
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><pre><code> <key>SharedSettings</key>
<dict>
<key>GCC_PRECOMPILE_PREFIX_HEADER</key>
<string>YES</string>
<key>GCC_PREFIX_HEADER</key>
<string>___PACKAGENAME___/MyFile.pch</string>
</dict>
</code></pre>
<p>改用这个语法。</p>
<p>对于 LD_RUNPATH_SEARCH_PATHS,您应该使用 <a href="https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath" rel="noreferrer noopener nofollow">Please Click here</a> 中的可执行文件之一或 <a href="https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/RunpathDependentLibraries.html" rel="noreferrer noopener nofollow">Apple's Doc</a> .</p>
<p>例如,我使用了@executable_path(@loader_path 也可以)</p>
<pre><code> <key>LD_RUNPATH_SEARCH_PATHS</key>
<string>$(inherited) @executable_path/Frameworks @executable_path/../Frameworks</string>
</code></pre></p>
<p style="font-size: 20px;">关于ios - XCode 7 自定义模板 : Change Build Settings,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/35619261/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/35619261/
</a>
</p>
页:
[1]