1# Copyright JS Foundation and other contributors, http://js.foundation 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14cmake_minimum_required(VERSION 3.8) 15 16include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) 17project(NONE) 18 19target_sources(app PRIVATE src/main-zephyr.c src/jerry-port.c src/getline-zephyr.c) 20 21add_library(jerry-core STATIC IMPORTED) 22add_library(jerry-ext STATIC IMPORTED) 23set_target_properties(jerry-core PROPERTIES IMPORTED_LOCATION 24 ${CMAKE_CURRENT_BINARY_DIR}/../obj/lib/libjerry-core.a) 25set_target_properties(jerry-core PROPERTIES INTERFACE_INCLUDE_DIRECTORIES 26 ${CMAKE_CURRENT_SOURCE_DIR}/../../jerry-core/include) 27set_target_properties(jerry-ext PROPERTIES IMPORTED_LOCATION 28 ${CMAKE_CURRENT_BINARY_DIR}/../obj/lib/libjerry-ext.a) 29set_target_properties(jerry-ext PROPERTIES INTERFACE_INCLUDE_DIRECTORIES 30 ${CMAKE_CURRENT_SOURCE_DIR}/../../jerry-ext/include) 31target_link_libraries(app PUBLIC jerry-core jerry-ext) 32 33zephyr_get_include_directories_for_lang_as_string(C includes) 34zephyr_get_system_include_directories_for_lang_as_string(C system_includes) 35zephyr_get_compile_definitions_for_lang_as_string(C definitions) 36zephyr_get_compile_options_for_lang_as_string(C options) 37 38add_custom_target( 39 outputexports 40 COMMAND echo CC="${CMAKE_C_COMPILER}" 41 COMMAND echo Z_CFLAGS=${system_includes} ${includes} ${definitions} ${options} 42 COMMAND echo NOSTDINC_FLAGS=${system_includes} 43 COMMAND echo ZEPHYRINCLUDE=${includes} 44 COMMAND echo KBUILD_CFLAGS=${definitions} ${options} 45 VERBATIM 46 USES_TERMINAL 47) 48 49