Adding .S file to Xcode target via qmake
-
Hello!
It looks like adding a .S file to SOURCES in a .pro file does not add the file to the target in Xcode, when running qmake with “-spec macx-xcode.”
What is the correct way to add a .S file to the build target when creating and Xcode project with qmake?
See example qmake project linked here.
Thank you!
-
Hi,
I can't currently confirm it works for that mkspec but:
CONFIG -= qt TEMPLATE = app SOURCES = main.c NASMEXTRAFLAGS = -f macho64 OTHER_FILES += $$NASM_SOURCES nasm.output = ${QMAKE_FILE_BASE}.o nasm.commands = nasm $$NASMEXTRAFLAGS -o ${QMAKE_FILE_BASE}.o ${QMAKE_FILE_NAME} nasm.input = NASM_SOURCES QMAKE_EXTRA_COMPILERS += nasm NASM_SOURCES += darwin.S
Will build the .S file when using the default mkspec.
Hope it helps
-
@SGaist said in Adding .S file to Xcode target via qmake:
Hi,
I can't currently confirm it works for that mkspec but:
CONFIG -= qt TEMPLATE = app SOURCES = main.c NASMEXTRAFLAGS = -f macho64 OTHER_FILES += $$NASM_SOURCES nasm.output = ${QMAKE_FILE_BASE}.o nasm.commands = nasm $$NASMEXTRAFLAGS -o ${QMAKE_FILE_BASE}.o ${QMAKE_FILE_NAME} nasm.input = NASM_SOURCES QMAKE_EXTRA_COMPILERS += nasm NASM_SOURCES += darwin.S
Will build the .S file when using the default mkspec.
Hope it helps
Yeah, I saw that I but I think it is a good contribution to the thread. It doesn't work for the mac-xcode make spec, however. Or at least in the form posted above.
I read somewhere that .S files are yet-to-be preprocessed .s files. Maybe it's possible that Xcode automatically registers this .S file for pre-processing when added to the target via the gui and maybe qmake is not prepared for that? No idea.
-
From a quick look, the Xcode project generator doesn't handle .S files at all currently.
-
Crap. It's a simple checkbox to add it to the target in the gui, I wonder if there is some way to hack this.
-
Can you compare the original Xcode projects and the one with that checkbox ticked ?