blob: 488e5e1024ab2f18289596531c7caf3363c8531c [file] [log] [blame]
Hao Chen1c8ea5b2023-10-20 23:03:45 +00001<<$srcs := getSources .M>>
2<<$includeDirs := getIncludeDirs .Ctx .M>>
3<<$cflags := (getCompilerProperties .M).Cflags>>
Tomasz Wasilczyk1e831bf2024-05-10 15:15:21 -07004<<$deps := mapLibraries .Ctx .M (concat5
Hao Chen1c8ea5b2023-10-20 23:03:45 +00005(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)>>
15add_<<getModuleType .M>>(<<.M.Name>> ${<<.M.Name>>_SRCS})
16<<- else>>
17add_<<getModuleType .M>>(<<.M.Name>> INTERFACE)
18<<- end>>
19add_<<getModuleType .M>>(android::<<.M.Name>> ALIAS <<.M.Name>>)
20<<print "">>
21
22<<- if $includeDirs>>
23<<setList .M.Name "_INCLUDES" "${ANDROID_BUILD_TOP}/" $includeDirs>>
24target_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>>
29target_compile_options(<<.M.Name>> PRIVATE ${<<.M.Name>>_CFLAGS})
30<<end>>
31
32<<- if $deps>>
33<<setList .M.Name "_DEPENDENCIES" "" $deps>>
34target_link_libraries(<<.M.Name>> <<if not $srcs>>INTERFACE <<end ->> ${<<.M.Name>>_DEPENDENCIES})
35<<end>>