Skip to content

Commit

Permalink
libethdrivers: cleanup cmake code
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Heider <[email protected]>
  • Loading branch information
Axel Heider committed Feb 29, 2024
1 parent 286b1ab commit b0cbdf2
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions libethdrivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,16 @@ if(KernelPlatformTx2)
endif()

# Provide the driver modules by forcing the linker to put these symbols in the
# library, instead of discarding them as unused. Using target_link_libraries()
# is a bit of a hack, target_link_options() would be the better way, but this
# requires CMake v3.13.
string(
JOIN
","
DriverModules
"-Wl"
"--undefined=tx2_ether_qos_ptr"
"--undefined=zynq7000_gem_ptr"
"--undefined=imx_fec_ptr"
"--undefined=odroidc2_ethernet_ptr"
# library, instead of discarding them as unused.
set(
EthernetDriverModules
"tx2_ether_qos"
"zynq7000_gem"
"imx_fec"
"odroidc2_ethernet"
)
target_link_libraries(ethdrivers "${DriverModules}")
foreach(module in LISTS EthernetDriverModules)
# Using target_link_libraries() is a bit of a hack, target_link_options()
# would be the better way, but this requires CMake v3.13.
target_link_libraries(ethdrivers "-Wl,--undefined=${module}_ptr")
endforeach()

0 comments on commit b0cbdf2

Please sign in to comment.