# Copyright (c) 2025 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.14)

project(TaiheRuntime C CXX)

option(ENABLE_RT_TEST "Enable my feature" OFF)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)

set(CMAKE_C_VISIBILITY_PRESET "hidden")
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")

# Handy for development use.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)


set(TAIHE_SOURCE src/string.cpp
              src/object.cpp
              src/runtime_ani.cpp)

add_library(taihe_runtime STATIC ${TAIHE_SOURCE})

set_target_properties(taihe_runtime PROPERTIES
    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
)

target_include_directories(taihe_runtime PUBLIC 
    include 
    ../compiler/.panda_vm/package/ohos_arm64/include/plugins/ets/runtime/ani)

target_compile_options(taihe_runtime PRIVATE -fPIC)
