cmake 版本:3.18.5 MinGW Makefiles 主机:windows 目标:ppc 编译器:windriver
我有一个程序集文件 file.s,其中包含一个标头 header.h(.include "header.h")。我已将标头的路径添加到 target_include_directories()。但汇编器无法找到指定的头文件。如何将包含目录传递给汇编程序?
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"