Enable specifying out-of-source platform configuration cmake file (#1941)

Resolve #1935, enable specifying out-of-source platform folder with
`cmake .. -DWAMR_BUILD_PLATFORM=new-os
               -DSHARED_PLATFORM_CONFIG=/path/to/new-os/shared_platform.cmake`
This commit is contained in:
Marcin Kolny
2023-02-07 14:10:59 +00:00
committed by GitHub
parent f3c1ad4864
commit 251e63f3ec
2 changed files with 23 additions and 9 deletions

View File

@ -19,6 +19,11 @@ endif ()
if (NOT DEFINED DEPS_DIR)
set (DEPS_DIR ${WAMR_ROOT_DIR}/core/deps)
endif ()
if (NOT DEFINED SHARED_PLATFORM_CONFIG)
# CMake file for platform configuration. The PLATFORM_SHARED_SOURCE varable
# should point to a list of platform-specfic source files to compile.
set (SHARED_PLATFORM_CONFIG ${SHARED_DIR}/platform/${WAMR_BUILD_PLATFORM}/shared_platform.cmake)
endif ()
if (DEFINED EXTRA_SDK_INCLUDE_PATH)
message(STATUS, "EXTRA_SDK_INCLUDE_PATH = ${EXTRA_SDK_INCLUDE_PATH} ")
@ -165,7 +170,7 @@ LIST (APPEND RUNTIME_LIB_HEADER_LIST ${header})
enable_language (ASM)
include (${SHARED_DIR}/platform/${WAMR_BUILD_PLATFORM}/shared_platform.cmake)
include (${SHARED_PLATFORM_CONFIG})
include (${SHARED_DIR}/mem-alloc/mem_alloc.cmake)
include (${IWASM_DIR}/common/iwasm_common.cmake)
include (${SHARED_DIR}/utils/shared_utils.cmake)