[CMake] gcc option passed to assembler
Michael Wild
themiwi at gmail.com
Thu Sep 16 09:03:34 EDT 2010
On 16. Sep, 2010, at 14:42 , skippy VonDrake wrote:
> Greetings,
> I have a project most of which is in C but it includes a couple of assembly
> files (.S).
> CMake builds it just fine until I add a preprocessor option meant for gcc -
> and that the assembler
> can't digest.
> Recently I set the COMPILE_FLAGS to include "-H". The compiler did as the
> flag specified.
> It listed all the headers in the dependency chain.
> But then I got the error:
> ... /usr/bin/as -o myAssemblyModule.S.o myAssemblyModule.S
> as: unrecognized option `-H`
>
> I know the assembly capabilities of cmake are still "experimental" but is
> there a way
> to keep an option from passing to the assembler?
>
> I'm using cmake 2.8 on FreeBSD 7.2 and using the KDevelop3 generator.
>
> Skippy
You could try to do something like this:
set(SRCS_C src1.c src2.c)
set(SRCS_ASM src3.S src4.S)
add_executable(foo ${SRCS_C} ${SRCS_ASM})
set_source_files_properties(${SRCS_C} PROPERTIES
COMPILE_FLAGS -H)
Michael
--
There is always a well-known solution to every human problem -- neat, plausible, and wrong.
H. L. Mencken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100916/80499c91/attachment.pgp>
More information about the CMake
mailing list