• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14project(ark_aot)
15
16set(GENERATED_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated)
17file(MAKE_DIRECTORY ${GENERATED_DIR})
18
19set(arkcompiler_OPTIONS_H ${GENERATED_DIR}/paoc_options.h)
20panda_gen_file(
21        DATAFILE ${CMAKE_CURRENT_LIST_DIR}/paoc.yaml
22        TEMPLATE ${PANDA_ROOT}/templates/options/options.h.erb
23        OUTPUTFILE ${arkcompiler_OPTIONS_H}
24        REQUIRES ${PANDA_ROOT}/templates/common.rb
25)
26add_custom_target(arkcompiler_options DEPENDS ${arkcompiler_OPTIONS_H})
27
28panda_add_executable(ark_aot
29    paoc.cpp
30)
31
32add_dependencies(ark_aot arkcompiler_options)
33
34target_link_libraries(ark_aot arkbase arkruntime aot_builder)
35
36target_include_directories(ark_aot
37    PUBLIC ${GENERATED_DIR}
38    PUBLIC ${PANDA_ROOT}/compiler/aot
39    PUBLIC ${PANDA_BINARY_ROOT}
40)
41
42panda_add_sanitizers(TARGET ark_aot SANITIZERS ${PANDA_SANITIZERS_LIST})
43
44# TODO: remove after all components will use ark_aot instead of paoc
45add_custom_target(paoc ALL
46                  COMMAND cd $<TARGET_FILE_DIR:ark_aot> && ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:ark_aot> paoc)
47
48add_dependencies(paoc ark_aot)
49
50add_check_style(".")
51panda_add_to_clang_tidy(TARGET ark_aot)
52