I tried changing from ASM to ASM-ATT and that fails like this:<br><br>/usr/bin/as -I/user/grc/msvdx-cvsfiles/sim/msvdx-cmake-2.8.5/systemC/src -I/user/grc/msvdx-cvsfiles/sim/msvdx-cmake-2.8.5/systemC/src/sysc/kernel -DNOMINMAX -DUSE_SIM_NAMESPACE -o CMakeFiles/systemc.dir/src/sysc/qt/md/i386.s.o /user/grc/msvdx-cvsfiles/sim/msvdx-cmake-2.8.5/systemC/src/sysc/qt/md/i386.s<br>
/usr/bin/as: unrecognized option `-NOMINMAX'<br><br>I really don't think the -I and -D options should be passed through for assembler files. They only make sense for C/C++ files. There should be a separate variable like CMAKE_ASM_FLAGS that is used instead of CMAKE_C_FLAGS or CMAKE_CXX_FLAGS. And maybe there needs to be a change to the add_definitions() command to allow an optional LANG argument ? Do assembers even support preprocessor definitions ?<br>
<br>I was able to get it to work for both 2.8.4 and 2.8.5 with the following code:<br><br>if(UNIX)<br> list(APPEND sources "src/sysc/qt/qt.c")<br><br> # see if we are building 32-bit or 64-bit executables<br>
file(WRITE ${CMAKE_BINARY_DIR}/check_32or64bit.cpp "int main(int argc, char *argv[]) { return 8 * sizeof(char *); }\n")<br><br> try_run(<br> run_result<br> compile_result<br> ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/check_32or64bit.cpp<br>
)<br> <br> if (${run_result} EQUAL 32)<br> list(APPEND sources "src/sysc/qt/md/i386.s")<br> if(APPLE)<br> set(ASM_SYS_FLAGS "-arch i386")<br> else()<br> set(ASM_SYS_FLAGS "-32")<br>
endif()<br> else()<br> list(APPEND sources "src/sysc/qt/md/iX86_64.s")<br> if(APPLE)<br> set(ASM_SYS_FLAGS "-arch x86_64")<br> else()<br> set(ASM_SYS_FLAGS "-64")<br>
endif()<br> endif()<br><br> enable_language(ASM-ATT)<br>
<br>
set(CMAKE_ASM-ATT_COMPILE_OBJECT "<CMAKE_ASM-ATT_COMPILER> ${ASM_SYS_FLAGS} -o <OBJECT> <SOURCE>")<br>endif()<br><br>I'm not sure if this is the recommended way to do this though. I thought the documentation said to override CMAKE_ASM-ATT_COMPILE_OBJECT before the enable_language() command. If I do that then I get the -I and -D flags back and my ASM_SYS_FLAGS variable is ignored. Is there a cleaner way to do this or is my current solution okay ?<br>
<br><br><div class="gmail_quote">2011/8/2 Alexander Neundorf <span dir="ltr"><<a href="mailto:a.neundorf-work@gmx.net">a.neundorf-work@gmx.net</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<div class="im"><br>
On Tuesday 02 August 2011, Glenn Coombs wrote:<br>
> Previously with cmake 2.8.4 we were using these lines to compile an<br>
<br>
</div>with 2.8.5 there was a major rework of the assembler support (and now it<br>
finally does not say "Assembler support is experimental" anymore).<br>
Sorry that this causes inconvenience for you.<br>
<br>
If you enable "ASM", you get support for assembler via your C/C++ compiler.<br>
That's why you get gcc now instead of as.<br>
If the C/C++ compiler does not support processing assembler files, this<br>
language can't be enabled.<br>
<br>
If you need a "real" assembler, you have to enable the respective assembler<br>
"dialect". E.g. to get as/gas, you need to enable "ASM-ATT".<br>
This should work with both versions.<br>
<br>
Let me know if this doesn't work for you.<br>
<br>
Alex<br>
</blockquote></div><br>