Android.mk file - including all source files in different folders and subfolders

前端 未结 2 1723
故里飘歌
故里飘歌 2021-02-08 14:10

In writing an android .mk file, is there a short way to include many source files which are in different folders and subfolders? Like a loop or a code for iterating the folders?

相关标签:
2条回答
  • 2021-02-08 14:50
    FILE_LIST := $(wildcard $(LOCAL_PATH)/*.cpp)
    FILE_LIST += $(wildcard $(LOCAL_PATH)/**/*.cpp)
    FILE_LIST += $(wildcard $(LOCAL_PATH)/**/**/*.cpp)
    LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
    
    0 讨论(0)
  • 2021-02-08 15:03

    You can use ** wildcard to include files from all subdirectories:

    LOCAL_SRC_FILES += $(patsubst $(LOCAL_PATH)/%, %, $(wildcard folder/**/*.cpp))
    
    0 讨论(0)
提交回复
热议问题