Skip to content

Use linker scripts instead of symlink. #472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions dpctl-capi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,24 +147,36 @@ target_link_libraries(DPCTLSyclInterface
PRIVATE ${IntelSycl_OPENCL_LIBRARY}
)

include(GetProjectVersion)
# the get_version function is defined in the GetProjectVersion module and
# defines: VERSION, SEMVER, MAJOR, MINOR, PATCH. These variables are populated
# by parsing the output of git describe.
get_version()
set_target_properties(DPCTLSyclInterface
PROPERTIES
VERSION ${VERSION_MAJOR}.${VERSION_MINOR}
SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}
)

if(UNIX)
set(linker_script1
"INPUT(libDPCTLSyclInterface.so.${VERSION_MAJOR}.${VERSION_MINOR})"
)
add_custom_command(TARGET DPCTLSyclInterface POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E remove "libDPCTLSyclInterface.so"
COMMAND "${CMAKE_COMMAND}"
-E echo "${linker_script1}" > "libDPCTLSyclInterface.so"
VERBATIM
)
endif()

if(DPCTL_ENABLE_LO_PROGRAM_CREATION)
target_include_directories(DPCTLSyclInterface
PRIVATE
${LEVEL_ZERO_INCLUDE_DIR}
)
endif()

# FIXME: Turning off for release until conda build can be packaging symbolic links
# NOTE: Till we hit 1.0.0 we will keep using the MINOR version to set the API
# version of the library.
# include(GetProjectVersion)
# the get_version function is defined in the GetProjectVersion module and
# defines: VERSION, SEMVER, MAJOR, MINOR, PATCH. These variables are populated
# by parsing the output of git describe.
# get_version()
# set_target_properties(DPCTLSyclInterface PROPERTIES VERSION ${VERSION_MINOR})
# set_target_properties(DPCTLSyclInterface PROPERTIES SOVERSION 1)

install(TARGETS
DPCTLSyclInterface
LIBRARY
Expand Down