SWDEV-273235 - Correct linker export file usage

CMake doesn't handle linker export files in a general way well. On
Windows it is able to recognize a .def file and pass it to the linker.
Unfortunately it cannot do the same thing on Linux, so we have to
manually specify it.

Note that CMake can't recognize the current Windows export file due to
the .in suffix, hence why the amdocl.def file is being added. The
amdocl.def.in file will be removed later, as the Makefile build still
uses it.

Change-Id: I33a4151af0257d56d46cd27cbd028b34b77b706b
This commit is contained in:
Vladislav Sytchenko
2021-05-31 19:28:19 -04:00
parent 40f87d6d86
commit 75b232eea2
3 changed files with 127 additions and 0 deletions
+1
View File
@@ -3,6 +3,7 @@ add_library(cltrace SHARED cltrace.cpp)
if(WIN32)
target_sources(cltrace PRIVATE cltrace.def)
else()
target_link_options(cltrace PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/cltrace.map")
set_target_properties(cltrace PROPERTIES LINK_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/cltrace.map")
endif()