platform_build_soong/cc/cmake_main.txt
Hao Chen 1c8ea5b6e1 Implement cc_cmake_snapshot
Bug: 302718225
Test: cd build/soong/cc && go test
Test: https://r.android.com/2803466
Change-Id: Ie7df635233ed68c40d917ea1f83f9fd4b5bfe729
2024-05-09 15:25:27 -07:00

29 lines
945 B
Text

cmake_minimum_required(VERSION 3.18)
project(<<.M.Name>> CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(AddAidlLibrary)
include(AppendCxxFlagsIfSupported)
if (NOT ANDROID_BUILD_TOP)
set(ANDROID_BUILD_TOP "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
set(PREBUILTS_BIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/prebuilts/host/linux-x86/bin")
if (NOT AIDL_BIN)
find_program(AIDL_BIN aidl REQUIRED HINTS "${PREBUILTS_BIN_DIR}")
endif()
<<cflagsList .M.Name "_CFLAGS" .M.Properties.Cflags .M.Properties.Unportable_flags .M.Properties.Cflags_ignored>>
<<range .Pprop.SystemPackages ->>
find_package(<<.>> REQUIRED)
<<end >>
<<range .Pprop.PregeneratedPackages ->>
add_subdirectory("${ANDROID_BUILD_TOP}/<<.>>" "<<.>>/build" EXCLUDE_FROM_ALL)
<<end>>
add_compile_options(${<<.M.Name>>_CFLAGS})
<<range $moduleDir, $value := .ModuleDirs ->>
add_subdirectory(<<$moduleDir>>)
<<end>>