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 14cmake_minimum_required(VERSION 3.5.2 FATAL_ERROR) 15 16# NB! This order of adding plugins is important, it should be the same 17# as in ark_config.gni's enabled_plugins list 18 19if (PANDA_WITH_ECMASCRIPT AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ecmascript") 20 add_subdirectory(ecmascript) 21elseif(PANDA_WITH_ECMASCRIPT) 22 message(FATAL_ERROR "ecmascript plugin is missing") 23endif() 24 25if (PANDA_WITH_ACCORD AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/accord") 26 add_subdirectory(accord) 27elseif(PANDA_WITH_ACCORD) 28 message(FATAL_ERROR "accord plugin is missing") 29endif() 30 31if (PANDA_WITH_CANGJIE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cangjie") 32 add_subdirectory(cangjie) 33elseif(PANDA_WITH_CANGJIE) 34 message(FATAL_ERROR "cangjie plugin is missing") 35endif() 36 37if (PANDA_WITH_JAVA AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/java") 38 add_subdirectory(java) 39elseif(PANDA_WITH_JAVA) 40 message(FATAL_ERROR "java plugin is missing") 41endif() 42 43if (PANDA_WITH_TESTS AND PANDA_WITH_RUNTIME AND PANDA_WITH_JAVA AND PANDA_WITH_ECMASCRIPT AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests_java_ecmascript") 44 add_subdirectory(tests_java_ecmascript) 45endif()