[CMake] The Xcode generator and ASM_NASM support

Gregor Jasny gjasny at googlemail.com
Wed Oct 3 13:28:59 EDT 2018


Hello,


On 10/3/18 6:08 PM, Tom Finegan via CMake wrote:
> I'm trying to get rid of some local CMake scripting for building assembly
> with nasm and yasm, but I'm running into a problem with the Xcode generator.
> 
> For the make and ninja generators, everything is fine-- nasm and yasm are
> both working as expected.
> 
> The same is not true for Xcode. When building a target that includes
> assembly files Xcode outputs the warnings like the following during its
> "Check dependencies" step:
> 
> warning: no rule to process file <assembly file> of type sourcecode for
> architecture x86_64

If the Xcode included nasm and the default Xcode flags are good enough 
for you you might get away with:

set_source_files_properties(${yasm_file} PROPERTIES
   XCODE_EXPLICIT_FILE_TYPE "sourcecode.nasm")

Otherwise I had to create a add_custom_command for every file and 
pointed to a shell script that based on all architectures found in ARCHS 
ran yasm and in the end called lipo to create the final fat .o file.

Hope that helps,
-Gregor


More information about the CMake mailing list