[CMake] ASM support

Phil Smith phil at voltage.com
Sun Mar 1 16:22:48 EST 2009


Yes, that was it. Thank you. I had hacked it into working by just setting CMAKE_ASM_COMPILER, but that was clearly a hack.

One nit that I did have to work around: it doesn't seem to support operands on the compiler name, though in trolling through code trying to understand what I'd done wrong, I saw things that looked like they might have been trying to.

IOW, if I:

SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "rexx.exe" "cc.rex dasm.exe")

then CMake works, but invokes rexx.exe without the "cc.rex dasm.exe" parameters. It happens that I can work around this for my application, but since it works in a toolchain file:

SET(CMAKE_C_COMPILER   "rexx.exe" "cc.rex dcc.exe")
SET(CMAKE_CXX_COMPILER "rexx.exe" "cc.rex dcxx.exe")

it seems like it should here (for varying values of "should").

I'd offer some updates to http://www.kwwidgets.org/Wiki/CMake/Assembler to help others avoid my idiocy if you're interested.

...phsiii
-----Original Message-----
From: Alexander Neundorf [mailto:a.neundorf-work at gmx.net]
Sent: Sunday, March 01, 2009 4:05 PM
To: cmake at cmake.org
Cc: Phil Smith
Subject: Re: [CMake] ASM support

On Thursday 26 February 2009, Phil Smith wrote:
> I got back on this, and found a big part of my problem. The Wiki page says:
>
> "Edit CMakeASM_FOOInformation.cmake. ... then include the generic
> CMakeASMInformation.cmake." and later:
> "Edit CMakeDetermineASM_FOOCompiler.cmake. ...then include the generic
> file..."
>
> What wasn't obvious to me (though of course it is now) was that the second
> "generic file" wasn't the same as the first. If the Wiki page could say
> "...then include the generic file CMakeDetermineASMCompiler.cmake" it would
> help.
>
> ISTR that if you say INCLUDE(banana.cmake) it looks for it in the local
> directory, whereas INCLUDE(banana) looks for it in Modules. This could be
> made clearer too, as "include the generic CMakeASMInformation.cmake" is
> likely to result in the former.
>
> Now...CMake says it works, but "make" says:
>
> [ 11%] Building ASM_DIGNUS object CMakeFiles/zfpe.dir/temp/ZOSFINFO.asm.o
> make[2]: CMAKE_ASM_COMPILER: Command not found
> make[2]: *** [CMakeFiles/zfpe.dir/temp/ZOSFINFO.asm.o] Error 127
> make[1]: *** [CMakeFiles/zfpe.dir/all] Error 2
> make: *** [all] Error 2
>
> I thought the issue was related to using a front-end script for the
> assembler, such that the actual command (if typed on the commandline) to do
> an assembly would be "rexx.exe cc.rex dasm.exe" (with flags and operands
> after that), but I simplified it to just "dasm" and get the same error.
>
> My CMakeASM_DIGNUSInformation.cmake is:
>
> set(ASM_DIALECT _DIGNUS)
> include(CMakeASMInformation)
> set(ASM_DIALECT)
> SET(CMAKE_ASM_DIGNUS_SOURCE_FILE_EXTENSIONS asm)
> SET(CMAKE_ASM_DIGNUS_OUTPUT_EXTENSION ".o" )
> SET(CMAKE_ASM_DIGNUS_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -o <OBJECT>
> <SOURCE>")

I think this should be:

SET(CMAKE_ASM_DIGNUS_COMPILE_OBJECT "<CMAKE_ASM_DIGNUS_COMPILER> -o <OBJECT>
  <SOURCE>")

Alex


More information about the CMake mailing list