[CMake] JWASM support

Alexander Neundorf a.neundorf-work at gmx.net
Mon Feb 9 15:58:06 EST 2009


On Friday 06 February 2009, Dmitry Bely wrote:
> On Tue, Feb 3, 2009 at 11:22 PM, Alexander Neundorf
>
> <a.neundorf-work at gmx.net> wrote:
> > On Tuesday 03 February 2009, Hendrik Sattler wrote:
> >> Dmitry Bely schrieb:
> >> >> If you use a toolchain file because you are cross-compiling, then you
> >> >> do not have this problem.
> >> >
> >> > I would like to use the same CMakeLists.txt for native Win32 and
> >> > cross-compiled Linux build. How to select the desired assembler then?
> >>
> >> Just like you select the C compiler in your toolchain file:
> >> set ( CMAKE_ASM_MASM_COMPILER /path/to/masm/or/jwasm )
> >
> > Or set the ASM_MASM environment variable to the assembler you want to use
> > before calling cmake (the same way as you can set CC or CXX before
> > running cmake).
>
> It's not enough: jwasm requires different options. Also redefine
> CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT? 

Yes.
If you have a look at CMake/Modules/CMakeASMInformation.cmake, you see that 
several optional more specific files can be used.
E.g. you could write a jwasm.cmake file, set the ..._COMPILE_OBJECT rule there 
and put it into CMake/Modules/Platform/, and it will be loaded automatically 
when jwasm is found.

If you need special settings e.g. for Windows, cygwin or Linux, you can also 
create a e.g. Windows-jwasm.cmake file and put the necessary information 
there.

> Not very convenient...

It's not much work and it has to be done only once. We would be happy about a 
patch which makes cmake work with jwasm.

Alex


More information about the CMake mailing list