Skip to content

Commit

Permalink
Xilinx: Make xilmem and xilstandalone library linkage conditional.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
edmooring authored and arnopo committed Oct 21, 2020
1 parent b67b169 commit b077d0d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ example toolchain file:
$ cmake <libmetal_source> -DCMAKE_TOOLCHAIN_FILE=<toolchain_file>
$ make VERBOSE=1 DESTDIR=<libmetal_install> 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.
Expand Down
2 changes: 2 additions & 0 deletions examples/system/generic/zynqmp_r5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
Expand Down
2 changes: 2 additions & 0 deletions test/system/generic/zynqmp_r5/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
Expand Down

0 comments on commit b077d0d

Please sign in to comment.