<div dir="ltr">Hi,<div><br></div><div>I am working on a C++ project which is using a single assembler file (among all the C++ files). In the mailinglist archives I found some hints on how to use the experimental ASM mode. However, as I only have a single ASM file, I'm not sure how to handle that: Ideally, I would like to pass it to add_library with all the other source files (in the same way I can pass it to C++ which automatically forwards it to the assembler). This is not working, so my intention was to build a library from the single ASM file using the ASM mode and then link the other C++ files against that library. This looks as follows:</div>
<div><br></div><div><div>cmake_minimum_required(VERSION 2.6)</div><div>project(TEST)<br></div><div>enable_language(ASM)</div><div>add_library(asmtest MyAsm.S)<br></div><div>set_target_properties(asmtest PROPERTIES LINKER_LANGUAGE ASM)</div>
<div>link_directories(".")<br></div><div>add_executable(test test.cxx)</div><div>target_link_libraries(test asmtest)</div><div><br></div><div>Unfortunately, this is not working either (the test target does not find the function defined in MyAsm). As it turns out, the reason is that libasmtest.a is empty (i.e. ar t libasmtest.a does no return anything). When building the libasmtest.a manually, it works (i.e. make test succeeds).</div>
<div><br></div><div>Can someone catch my mistake? I would prefer to avoid having to build a separate library for the assembler file, but at this point, I'm happy with any solution :-)</div><div><br></div><div>Thanks,</div>
<div><br></div><div>Stefan</div><div><br></div></div></div>