blob: e9177d6e2853d27f446c7b5ed224f4ed8a00252e [file] [log] [blame]
Hao Chen1c8ea5b2023-10-20 23:03:45 +00001cmake_minimum_required(VERSION 3.18)
2project(<<.M.Name>> CXX)
3set(CMAKE_CXX_STANDARD 20)
Tomasz Wasilczykc3177e02024-06-10 14:38:45 -07004enable_testing()
Hao Chen1c8ea5b2023-10-20 23:03:45 +00005
6set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
7include(AddAidlLibrary)
8include(AppendCxxFlagsIfSupported)
9
10if (NOT ANDROID_BUILD_TOP)
11 set(ANDROID_BUILD_TOP "${CMAKE_CURRENT_SOURCE_DIR}")
12endif()
13
14set(PREBUILTS_BIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/prebuilts/host/linux-x86/bin")
15if (NOT AIDL_BIN)
16 find_program(AIDL_BIN aidl REQUIRED HINTS "${PREBUILTS_BIN_DIR}")
17endif()
18
19<<cflagsList .M.Name "_CFLAGS" .M.Properties.Cflags .M.Properties.Unportable_flags .M.Properties.Cflags_ignored>>
20
21<<range .Pprop.SystemPackages ->>
22find_package(<<.>> REQUIRED)
23<<end >>
24<<range .Pprop.PregeneratedPackages ->>
25add_subdirectory("${ANDROID_BUILD_TOP}/<<.>>" "<<.>>/build" EXCLUDE_FROM_ALL)
26<<end>>
27add_compile_options(${<<.M.Name>>_CFLAGS})
28<<range $moduleDir, $value := .ModuleDirs ->>
29add_subdirectory(<<$moduleDir>>)
30<<end>>