@@ -147,24 +147,38 @@ target_link_libraries(DPCTLSyclInterface
147
147
PRIVATE ${IntelSycl_OPENCL_LIBRARY}
148
148
)
149
149
150
+ include (GetProjectVersion )
151
+ # the get_version function is defined in the GetProjectVersion module and
152
+ # defines: VERSION, SEMVER, MAJOR, MINOR, PATCH. These variables are populated
153
+ # by parsing the output of git describe.
154
+ get_version ()
155
+ set_target_properties (DPCTLSyclInterface
156
+ PROPERTIES
157
+ VERSION ${VERSION_MAJOR} .${VERSION_MINOR}
158
+ SOVERSION ${VERSION_MAJOR}
159
+ )
160
+
161
+ set (linker_script1
162
+ "INPUT(libDPCTLSyclInterface.so libDPCTLSyclInterface.so.${VERSION_MAJOR} )"
163
+ )
164
+ set (linker_script2
165
+ "INPUT(libDPCTLSyclInterface.so.${VERSION_MAJOR} libDPCTLSyclInterface.so.${VERSION_MAJOR} .${VERSION_MINOR} )"
166
+ )
167
+ add_custom_command (TARGET DPCTLSyclInterface POST_BUILD
168
+ COMMAND "${CMAKE_COMMAND} " -E remove "libDPCTLSyclInterface.so"
169
+ COMMAND "${CMAKE_COMMAND} " -E echo "${linker_script1} " > "libDPCTLSyclInterface.so"
170
+ COMMAND "${CMAKE_COMMAND} " -E remove "libDPCTLSyclInterface.so.${VERSION_MAJOR} "
171
+ COMMAND "${CMAKE_COMMAND} " -E echo "${linker_script2} " > "libDPCTLSyclInterface.so.${VERSION_MAJOR} "
172
+ VERBATIM
173
+ )
174
+
150
175
if (DPCTL_ENABLE_LO_PROGRAM_CREATION )
151
176
target_include_directories (DPCTLSyclInterface
152
177
PRIVATE
153
178
${LEVEL_ZERO_INCLUDE_DIR}
154
179
)
155
180
endif ()
156
181
157
- # FIXME: Turning off for release until conda build can be packaging symbolic links
158
- # NOTE: Till we hit 1.0.0 we will keep using the MINOR version to set the API
159
- # version of the library.
160
- # include(GetProjectVersion)
161
- # the get_version function is defined in the GetProjectVersion module and
162
- # defines: VERSION, SEMVER, MAJOR, MINOR, PATCH. These variables are populated
163
- # by parsing the output of git describe.
164
- # get_version()
165
- # set_target_properties(DPCTLSyclInterface PROPERTIES VERSION ${VERSION_MINOR})
166
- # set_target_properties(DPCTLSyclInterface PROPERTIES SOVERSION 1)
167
-
168
182
install (TARGETS
169
183
DPCTLSyclInterface
170
184
LIBRARY
0 commit comments