Skip to content

Commit 62d67cf

Browse files
Execute linker script on Unix only
1 parent b41726c commit 62d67cf

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

dpctl-capi/CMakeLists.txt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,17 @@ set_target_properties(DPCTLSyclInterface
158158
SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}
159159
)
160160

161-
set(linker_script1
162-
"INPUT(libDPCTLSyclInterface.so.${VERSION_MAJOR}.${VERSION_MINOR})"
163-
)
164-
add_custom_command(TARGET DPCTLSyclInterface POST_BUILD
165-
COMMAND "${CMAKE_COMMAND}" -E remove "libDPCTLSyclInterface.so"
166-
COMMAND "${CMAKE_COMMAND}" -E echo "${linker_script1}" > "libDPCTLSyclInterface.so"
167-
VERBATIM
168-
)
161+
if(UNIX)
162+
set(linker_script1
163+
"INPUT(libDPCTLSyclInterface.so.${VERSION_MAJOR}.${VERSION_MINOR})"
164+
)
165+
add_custom_command(TARGET DPCTLSyclInterface POST_BUILD
166+
COMMAND "${CMAKE_COMMAND}" -E remove "libDPCTLSyclInterface.so"
167+
COMMAND "${CMAKE_COMMAND}"
168+
-E echo "${linker_script1}" > "libDPCTLSyclInterface.so"
169+
VERBATIM
170+
)
171+
endif()
169172

170173
if(DPCTL_ENABLE_LO_PROGRAM_CREATION)
171174
target_include_directories(DPCTLSyclInterface

0 commit comments

Comments
 (0)