From b077d0d308bc4b2f234d2586ca3c1d9e06619d6c Mon Sep 17 00:00:00 2001 From: Ed Mooring Date: Thu, 15 Oct 2020 14:48:21 -0700 Subject: [PATCH] Xilinx: Make xilmem and xilstandalone library linkage conditional. In v2019.1, the xilmem and xilstandalone libraries were removed from the standalone Xilinx BSP for the R5. This change adds a CMake variable, XILINX_PRE_V2019, to conditionally add these libraries to the link command for use with older BSPs. Signed-off-by: Ed Mooring --- README.md | 6 +++++- examples/system/generic/zynqmp_r5/CMakeLists.txt | 2 ++ test/system/generic/zynqmp_r5/CMakeLists.txt | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 950db348..b3e24490 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,11 @@ example toolchain file: $ cmake -DCMAKE_TOOLCHAIN_FILE= $ make VERBOSE=1 DESTDIR= install ``` - +* Note: When building baremetal for Xilinx 2018.3 or earlier environments, +add -DXILINX_PRE_V2019 to your CMake invocation. This will include the +xilmem and xilstandalone libraries in your build. These libraries were +removed in 2019.1. + ### Building for Zephyr The [zephyr-libmetal](https://github.com/zephyrproject-rtos/libmetal) implements the libmetal for the Zephyr project. It is mainly a fork of this repository, with some add-ons for integration in the Zephyr project. diff --git a/examples/system/generic/zynqmp_r5/CMakeLists.txt b/examples/system/generic/zynqmp_r5/CMakeLists.txt index 037548f9..3f87873f 100644 --- a/examples/system/generic/zynqmp_r5/CMakeLists.txt +++ b/examples/system/generic/zynqmp_r5/CMakeLists.txt @@ -5,8 +5,10 @@ collect(PROJECT_LIB_DEPS c) collect(PROJECT_LIB_DEPS m) set (_lib "xil") +if (XILINX_PRE_V2019) list (APPEND _lib "xilmem") list (APPEND _lib "xilstandalone") +endif (XILINX_PRE_V2019) find_library (_lib_path ${_lib}) if (NOT _lib_path) message ( "external library ${_lib_path} not found" ) diff --git a/test/system/generic/zynqmp_r5/CMakeLists.txt b/test/system/generic/zynqmp_r5/CMakeLists.txt index 4a7eee0f..4c307591 100644 --- a/test/system/generic/zynqmp_r5/CMakeLists.txt +++ b/test/system/generic/zynqmp_r5/CMakeLists.txt @@ -1,8 +1,10 @@ collect (PROJECT_LIB_TESTS helper.c) set (_test_lib_external "xil") +if (XILINX_PRE_V2019) list (APPEND _test_lib_external "xilmem") list (APPEND _test_lib_external "xilstandalone") +endif (XILINX_PRE_V2019) collect (PROJECT_LIB_DEPS ${_test_lib_external})