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