0

cmake version : 3.18.5 MinGW Makefiles Host : windows target : ppc compiler : windriver

I have a assembly file file.s which includes a header header.h( .include "header.h"). I have added the path of the header to the target_include_directories(). But the assembler is not able to find the header file specified. How to pass the include directories to the assembler ?

main/CMakeLists.txt
project(myProject LANGUAGES C ASM)

sub/CMakeList.txt
file(GLOB srcLib ${sub}/*.c ${sub}/*.s)
set_property(SOURCE ${sub}/file.s  PROPERTY LANGUAGE ASM)
add_library(subLib  STATIC ${srcLib})
set(INC ${sub}/inc)
target_include_directories(subLib  PRIVATE ${INC})


file.s
 .include "header.h"
deepan muthusamy
  • 321
  • 2
  • 14
  • You forgot to add your **code** into the question post. Without the code we cannot help you in fixing it. See e.g. [that question](https://stackoverflow.com/questions/39321051/why-cant-nasm-find-include-statements-from-cmake), which describes the similar problem but provides a code. See also [ask]. – Tsyvarev Mar 05 '21 at 17:59
  • Did you enable `ASM` as a language in the `project()` command? – Alex Reinking Mar 05 '21 at 19:48
  • yes @AlexReinking.. i have updated the question – deepan muthusamy Mar 06 '21 at 17:46
  • @Tsyvarev, i have updated the code. kindly let me know if any more info required.. – deepan muthusamy Mar 06 '21 at 17:49

0 Answers0