Another popular question is how to make changes to a Library delivered in Vitis Unified IDE. If users make changes to the local sources in the library in the BSP, then these will be lost upon a regeneration of the BSP. To maintain the modifications in the Library, then user will need to make a local copy of the library in the Vitis install to a local drive and point to this in the Vitis -> Embedded SW Repositories...
In the example below, I added a local copy of the LwIP library to the folder structure repo/ThirdParty/sw_services/lwip220_v1_2, and added this to the Local Repositories in Embedded SW repositories
Note: The folder hierarchy is important here.
The tools will search for a BSP/Library or Driver in the Local Repository. If a component is found here and it is greater or the same version as the one found in the install, then this component will be used.
I updated the yaml file description to hightlight, that this is a customer version of the library
description: |-
Custom lwip220 library lwIP (light weight IP) is an open source TCP/IP stack configured for AMD hard and soft Ethernet MACs.
This can be seen in the Board Support settings
Users can see the existing Configuration options for the Libary below
If users want to add custom options, then create the cmake CACHE variable first in the lwip220.cmake. For example, here I added a ENABLE_DNS config option.
set(lwip220_enable_dns 0 CACHE STRING "Enable DNS")
set_property(CACHE lwip220_enable_dns PROPERTY STRINGS 0 1)
...
if (${lwip220_enable_dns})
set(ENABLE_DNS 1)
endif()
Next, users need to add that in lwipopts.h.in file with the defined cmake variable.
#cmakedefine01 ENABLE_DNS @ENABLE_DNS@
If users do a Regenerate BSP and review the library Configuration options, then the new lwip220_enable_dns option should be added.
If i set this from 0 to 1 then this will now be added in the lwipopts.h file