[CMake] ASM on the Mac

Alexander Neundorf a.neundorf-work at gmx.net
Mon Nov 5 12:26:38 EST 2012


On Monday 05 November 2012, Mike Krus wrote:
> Hi
> 
> got some issues compiling ASM of Mac, mixed with other C++ code. In my
> CMake file I use:
> 
>         INCLUDE(CheckLanguage)
> 
>         check_language(ASM)
> 
>         if(CMAKE_ASM_COMPILER)
> 
>                 enable_language(ASM)
> 
>                 LIST(APPEND nm_tls_ALL_src src/FlowScalarField64.asm)
> 
>                 ADD_DEFINITIONS( -DINTEL_SIMD )
> 
>         else()
> 
>                 message(STATUS "No ASM support")
> 
>         endif()
> 
> 
> nm_tls_ALL_src is a list of C++ files. It's then used to create a shared
> library.
> 
> Using the ninja generator, I get this error when compiling:
> Building ASM object
> products/4DMove/tools/sediment/CMakeFiles/nm_tls_sediment.dir/src/FlowScal
> arField64.asm.o i686-apple-darwin11-llvm-gcc-4.2:
> ../../products/4DMove/tools/sediment/src/FlowScalarField64.asm: linker
> input file unused because linking not done
> 
> Seems that gcc is thinking that file is an object file already and trying
> to link it rather than compile it.
> 
> Any suggestions?

Can you make that verbose, so the full command is shown ?
Maybe it needs different flags with clang.

Alex


More information about the CMake mailing list