Enable cmake testing

Bug: 302718225
Test: atest binder_sdk_test
Change-Id: Id841d73d11f3b0c75f7bcd523be8ff69300a503e
This commit is contained in:
Tomasz Wasilczyk
2024-06-10 14:38:45 -07:00
parent 6ace4cf906
commit c3177e0ffc
3 changed files with 15 additions and 5 deletions

View File

@@ -8,15 +8,24 @@
(getLinkerProperties .M).Header_libs
(getExtraLibs .M)
) .Pprop.LibraryMapping>>
<<$moduleType := getModuleType .M>>
<<$moduleTypeCmake := "executable">>
<<if eq $moduleType "library">>
<<$moduleTypeCmake = "library">>
<<end>>
# <<.M.Name>>
<<if $srcs>>
<<setList .M.Name "_SRCS" "${ANDROID_BUILD_TOP}/" (toStrings $srcs)>>
add_<<getModuleType .M>>(<<.M.Name>> ${<<.M.Name>>_SRCS})
add_<<$moduleTypeCmake>>(<<.M.Name>> ${<<.M.Name>>_SRCS})
<<- else>>
add_<<getModuleType .M>>(<<.M.Name>> INTERFACE)
add_<<$moduleTypeCmake>>(<<.M.Name>> INTERFACE)
<<- end>>
<<- if eq $moduleType "library">>
add_library(android::<<.M.Name>> ALIAS <<.M.Name>>)
<<- else if eq $moduleType "test">>
add_test(NAME <<.M.Name>> COMMAND <<.M.Name>>)
<<- end>>
add_<<getModuleType .M>>(android::<<.M.Name>> ALIAS <<.M.Name>>)
<<print "">>
<<- if $includeDirs>>