Questions tagged [build-rules]
23 questions
87
votes
6 answers
How can I conditionally include a file based on build configuration in Xcode?
I have an Xcode project with a large number of targets where I would like to include a settings bundle for apps built under the Ad-hoc and Debug configurations, but not under the Release configuration.
Build Phases don't seem to allow for making…

Frank Schmitt
- 25,648
- 10
- 58
- 70
30
votes
2 answers
build rules for xcode / iPhone
Im incorporating the facebook SDK into an update and i get compiler warnings for four files,in one of my targets each file gets two warnings like these.
[WARN]warning: no rule to process file '$(PROJECT_DIR)/APP_NAME/Facebook.h' of type…

Jef
- 4,728
- 2
- 25
- 33
7
votes
3 answers
Xcode 4 custom build step before compile
I'm trying to integrate a tool into Xcode 4 that generates a C header from a descriptor file. In Xcode 3 it worked to add a custom build step for files with a specific extension. Those files then get compiled before the .m/.mm/.cpp files that…

user408952
- 882
- 9
- 23
6
votes
3 answers
Xcode 5.0: Apple where is Add Build rule gone?
I cannot find Add Custom Build Rule option on Version 5.0 (5A1413). Does anyone noticed it? Has it been moved somewhere else?
As a work around I am clicking "Copy to Target" on any build rule and customising it to make it custom…

Paresh Masani
- 7,474
- 12
- 73
- 139
3
votes
1 answer
How do I move a bazel build target?
All of the bazel rules put the build targets in a specific place.
I can find the targets through bazel-bin/, but they are all scattered recursively with other non-target files I don't care about.
How do I write a build rule that puts all my…

Trevor Hickey
- 36,288
- 32
- 162
- 271
3
votes
2 answers
What Xcode "Build Rules" does?
I am new in Xcode. From the "Targets" in Xcode, I could see that there is a Tab called "Build Rules".
I wonder what is this tab does?
Thanks

user454083
- 1,337
- 3
- 16
- 31
3
votes
2 answers
Expressions in a build rule "Output Files"?
Can you include expressions in the "Output Files" section of a build rule in Xcode? Eg:
$(DERIVED_FILE_DIR)$(echo "/dynamic/dir")/$(INPUT_FILE_BASE).m
Specifically, when translating Java files with j2objc, the resulting files are saved in…

Calin
- 2,110
- 1
- 21
- 36
1
vote
1 answer
Emulate GLSL #import via Xcode build
A few of my GLSL fragment shaders share common functions and constants. I can't find any #import-like functionality in GLSL (understandably), but it'd be super-cool if I could emulate that in Xcode's build stage. It could be as simple as appending a…

andyvn22
- 14,696
- 1
- 52
- 74
1
vote
1 answer
Can I error if my bazel target generates files that aren't specified in its outs?
Inside a .bzl file,
I specify a program to generate some code.
It looks something like this:
def generate_code():
native.genrule(
name = "foo",
outs = ["file.hpp"],
tools = ["//path/to:tool"],
cmd = $(location…

Trevor Hickey
- 36,288
- 32
- 162
- 271
1
vote
1 answer
Custom Build Rule fails after converting to VS2013
I need to integrate a legacy VS2008 project into my VS2013 solution. This project uses some custom build rules which initially worked after converting the .vcproj to a .vcxproj. However, when doing a fresh checkout of the project including the…

Tim Meyer
- 12,210
- 8
- 64
- 97
1
vote
3 answers
How to compile different extension files as C++ in Visual Studio C++ 2010?
In my Visual Studio 2010 project I have files with .mm file extension, that need to be compiled as normal C++ files. Is there a way to make a build rule for new extensions or something like that? In VS 2008 there were options for that, but they are…

Smilediver
- 1,738
- 23
- 26
1
vote
2 answers
Why does CUDA.rules have two identical command lines
The commandline for CUDA.rules file is:
echo [CompilerPath] [Keep]
[CInterleavedPTX] [ExtraNvccOptions]
[Arch] -ccbin
"$(VCInstallDir)bin"
[Emulation] [FastMath] [Defines]
-Xcompiler "/EHsc [Warning] /nologo [Optimization] /Zi
…

zenna
- 9,006
- 12
- 73
- 101
1
vote
1 answer
Adding a new build rule to parse all rtf files
Xcode includes a flexible build rules system. The documentation is all but non-existant however.
A project I am working on for iOS 5 and iOS 6 includes an rtf help file. For iOS 6, I can convert the rtf file into an archived NSAttributedString…

Duncan C
- 128,072
- 22
- 173
- 272
0
votes
1 answer
Make Xcode build a C file generated by processing a file with a custom extension
I'm trying to set up Xcode to build generated .c files just like it does for files generated by yacc (*.y) and lex (*.l) files.
Say I have input files with a *.corn extension that are meant to be processed by a tool of mine to create C source files.…

Mustang
- 363
- 2
- 9
0
votes
1 answer
How can I generalize a custom command into a generic-make-rule-like construct?
In this question:
How can I build a fatbin file using CMake?
we saw how to formulate a pair of add_custom_command() and add_custom_target() commands, for building a .fatbin file out of a .cu file:
add_custom_command(
OUTPUT my_src.fatbin
…

einpoklum
- 118,144
- 57
- 340
- 684