[CMake] Using clang + assembly language (cross compilation)

Emmanuel Blot eblot.ml at gmail.com
Wed Dec 17 04:15:56 EST 2014


Hi,

Is there a special order to make CMake recognize .S files - with Clang
toolchain - as valid source files?

-- ASM: /usr/local/bin/clang
-- The ASM compiler identification is Clang
-- Found assembler: /usr/local/bin/clang
-- Configuring done
CMake Error at lib/CMakeLists.txt:9 (ADD_LIBRARY):
  Cannot find source file:

   .../lib/arch/arm/gen/divide.S

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx

with

INCLUDE (Platform/Generic)
...
FIND_PROGRAM (xcc clang)

SET (CMAKE_ASM_COMPILER_ID Clang)

INCLUDE (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER (${xcc} Clang)
CMAKE_FORCE_CXX_COMPILER (${xcc} Clang)
SET (CMAKE_ASM_COMPILER ${xcc})

...

PROJECT (project C ASM)

...


Thanks,
Manu.


More information about the CMake mailing list