0

I have a project containing C files, header files and other files with different extensions like:

Parent folder/C foolder/... all c Files.
Parent folder/Header folder/ ... all header files

Now, what I want is to compile only few c files from c folder and same for header. After looking at few links at stackoverflow like this post about how to exclude files with .m extensions by adding
-fno-objc-arc compiler flag, but doesn't explains how to exclude .c files.

Community
  • 1
  • 1

1 Answers1

2

This is accomplished within Xcode by defining which source files are associated with a particular build target.

Each Xcode project can have multiple targets and source files can be associated with one or more targets.

Header files are not associated in the same way, but get their association by whatever source files include/import them.

You can set the target when you add the file to Xcode (reference) and you can change it later via the source file's properties (reference).

trojanfoe
  • 120,358
  • 21
  • 212
  • 242