[CMake] assembly files with masm in vs2005 64bit
Bram de Greve
bram.degreve at gmail.com
Mon Oct 27 07:17:12 EDT 2008
Hi Alexander,
Thanks for your quick response!
2008/10/24 Alexander Neundorf <a.neundorf-work at gmx.net>
> On Friday 24 October 2008, Alexander Neundorf wrote:
> >
> > Yes, I think you're the first one who tries that.
> >
>
Alright! =)
>
> > > This is the custom build step I need to perform (copy pasted from a
> > > handcrafted solution file):
> > >
> > > ml64 -c -Zi "-Flfoobar.lst" "-FRfoobar.sbr" "-Fofoobar.obj"
> "foobar.asm"
> >
> > Are -Fl and -FR necessary or does it also work without them ?
> >
>
The foobar.lst one isn't necessary. The second one only is necessary if
browse information is needed. Not sure if that is the case ...
>
> Ok, it was a bit faster (waiting for Qt to build...)
>
> So, please put the three attached files into the cmake Modules/ directory
> and
> use
> ENABLE_LANGUAGE(ASM-MASM)
> This should find ml64.exe .
> If it doesn't, try hardcoding it for now in
> CMakeDetermineASM-MASMCompiler.cmake.
> Let me know which problems you hit.
>
> Alex
>
I already tried something similar, though I got stuck halfway.
Anyway, I dropped in your files in my source directory, which I've added to
the module path as follows:
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
cmake seems to pick them up alright. But the result doesn't seem to work.
I've tried it in two ways:
1. Using the Visual Studio 2005 Win64 generator to create solution files
- Here the minor problem is, as you already predicted, that it doesn't
automatically detect ml64.exe but a manual configuration of the variable
does help
- the asm file appears in the project, but there doesn't seem to be any
build rule associated with it. Nor as a custom build step in the properties
pages, nor as a CMake rule
- as a result, the asm file does not get build, yielding some unresolved
symbols at linking time
2. Using nmake from the VS2005 x64 command prompt
- The first issue is that nmake doesn't like the dashes in variable/macro
names. So I had to replace it by an underscore in the dialect strings:
SET(ASM_DIALECT "_MASM")
- Again, no build rule for the asm file gets inserted, resulting again in
unresolved symbols.
- Then it dawned to me that there were other places to replace -MASM by
_MASM: in enable_language, when setting the asm file's language property,
and also in the filenames of the cmake files you gave me.
- Now, build rules are created, but no obj files are being build. I had to
move <SOURCE> to the end:
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT
"<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> /c /Fo <OBJECT> <SOURCE>")
- Now, obj file is build, it is enlisted in objects.rsp, but the linker
still can't find its symbols ...
But at least, we're one or two steps closer =)
1. Why doesn't the asm file get any rules in the solution file?
2. Why are the symbols still unresolved in the nmake situation?
Cheers,
Bram
--
hi, i'm a signature viruz, plz set me as your signature and help me spread
:)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081027/c5072171/attachment-0001.htm>
More information about the CMake
mailing list