Hao Chen | 1c8ea5b | 2023-10-20 23:03:45 +0000 | [diff] [blame^] | 1 | <<$srcs := getSources .M>> |
| 2 | <<$includeDirs := getIncludeDirs .Ctx .M>> |
| 3 | <<$cflags := (getCompilerProperties .M).Cflags>> |
| 4 | <<$deps := mapLibraries (concat5 |
| 5 | (getLinkerProperties .M).Whole_static_libs |
| 6 | (getLinkerProperties .M).Static_libs |
| 7 | (getLinkerProperties .M).Shared_libs |
| 8 | (getLinkerProperties .M).Header_libs |
| 9 | (getExtraLibs .M) |
| 10 | ) .Pprop.LibraryMapping>> |
| 11 | |
| 12 | # <<.M.Name>> |
| 13 | <<if $srcs>> |
| 14 | <<setList .M.Name "_SRCS" "${ANDROID_BUILD_TOP}/" (toStrings $srcs)>> |
| 15 | add_<<getModuleType .M>>(<<.M.Name>> ${<<.M.Name>>_SRCS}) |
| 16 | <<- else>> |
| 17 | add_<<getModuleType .M>>(<<.M.Name>> INTERFACE) |
| 18 | <<- end>> |
| 19 | add_<<getModuleType .M>>(android::<<.M.Name>> ALIAS <<.M.Name>>) |
| 20 | <<print "">> |
| 21 | |
| 22 | <<- if $includeDirs>> |
| 23 | <<setList .M.Name "_INCLUDES" "${ANDROID_BUILD_TOP}/" $includeDirs>> |
| 24 | target_include_directories(<<.M.Name>> <<if $srcs>>PUBLIC<<else>>INTERFACE<<end>> ${<<.M.Name>>_INCLUDES}) |
| 25 | <<end>> |
| 26 | |
| 27 | <<- if and $srcs $cflags>> |
| 28 | <<cflagsList .M.Name "_CFLAGS" $cflags .Snapshot.Properties.Unportable_flags .Snapshot.Properties.Cflags_ignored>> |
| 29 | target_compile_options(<<.M.Name>> PRIVATE ${<<.M.Name>>_CFLAGS}) |
| 30 | <<end>> |
| 31 | |
| 32 | <<- if $deps>> |
| 33 | <<setList .M.Name "_DEPENDENCIES" "" $deps>> |
| 34 | target_link_libraries(<<.M.Name>> <<if not $srcs>>INTERFACE <<end ->> ${<<.M.Name>>_DEPENDENCIES}) |
| 35 | <<end>> |