From 7b09ac8446d55424e03bd2b1039aa0cf6277d14a Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 22 May 2018 10:38:26 -0500 Subject: [PATCH] ext: libmetal: Update import of libmetal Pull in a slightly more recent version of libmetal with changes to the build system to improve integration with Zephyr. This change will break anything that builds with Zephyr and libmetal (which at this point is only the open-amp example). Will fix that shortly. Signed-off-by: Kumar Gala --- README | 4 ++-- libmetal/CMakeLists.txt | 9 ++++++--- libmetal/cmake/options.cmake | 4 ++++ libmetal/cmake/syscheck.cmake | 5 +++-- libmetal/lib/CMakeLists.txt | 1 + 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README b/README index 29d052a..c24fe57 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ Origin: https://github.com/OpenAMP/libmetal Status: - 606c31438025b9fb1515dace1c642d5835d8d33c [v2018.04] + b4b5beab4b71388d63c732470b6d6da606ae8ffc When we import libmetal we removed the tests/ and examples/ dir to reduce the amount of code imported. @@ -29,7 +29,7 @@ URL: https://github.com/OpenAMP/libmetal commit: - 606c31438025b9fb1515dace1c642d5835d8d33c + b4b5beab4b71388d63c732470b6d6da606ae8ffc Maintained-by: External diff --git a/libmetal/CMakeLists.txt b/libmetal/CMakeLists.txt index 572b0f2..d8a56c9 100644 --- a/libmetal/CMakeLists.txt +++ b/libmetal/CMakeLists.txt @@ -1,9 +1,12 @@ cmake_minimum_required (VERSION 2.6) +if (POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) +endif() list (APPEND CMAKE_MODULE_PATH - "${CMAKE_SOURCE_DIR}/cmake" - "${CMAKE_SOURCE_DIR}/cmake/modules" - "${CMAKE_SOURCE_DIR}/cmake/platforms") + "${CMAKE_CURRENT_SOURCE_DIR}/cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/platforms") include (syscheck) project (metal C) diff --git a/libmetal/cmake/options.cmake b/libmetal/cmake/options.cmake index ff59e93..a354c18 100644 --- a/libmetal/cmake/options.cmake +++ b/libmetal/cmake/options.cmake @@ -51,6 +51,10 @@ if (WITH_TESTS AND (${_host} STREQUAL ${_target})) option (WITH_TESTS_EXEC "Run test applications during build" ON) endif (WITH_TESTS AND (${_host} STREQUAL ${_target})) +if (WITH_ZEPHYR) + option (WITH_ZEPHYR_LIB "Build libmetal as a zephyr library" OFF) +endif (WITH_ZEPHYR) + option (WITH_DEFAULT_LOGGER "Build with default logger" ON) option (WITH_DOC "Build with documentation" ON) diff --git a/libmetal/cmake/syscheck.cmake b/libmetal/cmake/syscheck.cmake index 3d3be67..1ff4a12 100644 --- a/libmetal/cmake/syscheck.cmake +++ b/libmetal/cmake/syscheck.cmake @@ -4,8 +4,9 @@ if (WITH_ZEPHYR) set (CMAKE_SYSTEM_NAME "Generic" CACHE STRING "") string (TOLOWER "Zephyr" PROJECT_SYSTEM) string (TOUPPER "Zephyr" PROJECT_SYSTEM_UPPER) - set(IS_TEST 1) - include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) + if (NOT WITH_ZEPHYR_LIB) + include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) + endif() if (CONFIG_CPU_CORTEX_M) set (MACHINE "cortexm" CACHE STRING "") endif (CONFIG_CPU_CORTEX_M) diff --git a/libmetal/lib/CMakeLists.txt b/libmetal/lib/CMakeLists.txt index ae78fb8..96a3102 100644 --- a/libmetal/lib/CMakeLists.txt +++ b/libmetal/lib/CMakeLists.txt @@ -64,6 +64,7 @@ if (WITH_ZEPHYR) zephyr_library_named(metal) add_dependencies(metal offsets_h) target_sources (metal PRIVATE ${_sources}) + zephyr_include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) else (WITH_ZEPHYR) # Build a shared library if so configured. if (WITH_SHARED_LIB)