[CMake] How to pass -D options when compiling assembly files using gcc?

Marcel Loose loose at astron.nl
Fri Jul 10 10:41:23 EDT 2009


Hi all,

I'm trying to build a library that has, amongst a number of C/C++
sources, a number of assembly files as input. These are .S files which
need to be cross-compiled for BG/P by gcc, not by as (or gas) directly. 

I have defined a number of preprocessor definitions (-D options) using
add_definitions(). I noticed that these options are not passed to the
command line when compiling the assembly files, only when compiling the
C/C++ sources.

Is there any way I can pass these -D options to the assembler as well?

If needed, I can attach the files CMakeASM-BGPInformation.cmake,
CMakeTestASM-BGPCompiler.cmake and CMakeDetermineASM-BGPCompiler.cmake
that I wrote.

Best regards,
Marcel Loose.





More information about the CMake mailing list