Skip to content

Commit 9e410ee

Browse files
raramakrlamb-j
authored andcommitted
SWDEV-442738 - Static package generation for hipcc
Package name will have suffix static-dev/devel Corrected the rocm-core dependency removal as well Change-Id: I0cff13867557f18f2d7cb2f9f091fce66d960733 (cherry picked from commit c5276e374a79e74f7640eb22888ea1658a3c5190)
1 parent bba477d commit 9e410ee

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

amd/hipcc/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ if(ROCM_FOUND)
1111
rocm_setup_version(VERSION "${hipcc_VERSION}")
1212
endif()
1313

14+
# Generate static package, when BUILD_SHARED_LIBS is set to OFF.
15+
# Default to ON
16+
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
17+
1418
set(CMAKE_CXX_STANDARD 17)
1519
set(CMAKE_CXX_STANDARD_REQUIRED True)
1620

@@ -184,7 +188,23 @@ endif()
184188

185189
if(NOT ROCM_DEP_ROCMCORE)
186190
string(REGEX REPLACE ",? ?rocm-core" "" CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS})
191+
string(REGEX REPLACE ",? ?rocm-core" "" CPACK_DEBIAN_AMD_PACKAGE_DEPENDS ${CPACK_DEBIAN_AMD_PACKAGE_DEPENDS})
192+
string(REGEX REPLACE ",? ?rocm-core" "" CPACK_DEBIAN_NVIDIA_PACKAGE_DEPENDS ${CPACK_DEBIAN_NVIDIA_PACKAGE_DEPENDS})
187193
string(REGEX REPLACE ",? ?rocm-core" "" CPACK_RPM_PACKAGE_REQUIRES ${CPACK_RPM_PACKAGE_REQUIRES})
194+
string(REGEX REPLACE ",? ?rocm-core" "" CPACK_RPM_AMD_PACKAGE_REQUIRES ${CPACK_RPM_AMD_PACKAGE_REQUIRES})
195+
string(REGEX REPLACE ",? ?rocm-core" "" CPACK_RPM_NVIDIA_PACKAGE_REQUIRES ${CPACK_RPM_NVIDIA_PACKAGE_REQUIRES})
196+
endif()
197+
198+
# Static packaging
199+
if(NOT BUILD_SHARED_LIBS)
200+
# For static builds change the pakage name
201+
set(CPACK_DEBIAN_AMD_PACKAGE_NAME "hipcc-static-dev")
202+
set(CPACK_RPM_AMD_PACKAGE_NAME "hipcc-static-devel")
203+
# hip-dev/devel dependency not applicable fot static package
204+
string(REPLACE "hip-dev," "" CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS})
205+
string(REPLACE "hip-dev," "" CPACK_DEBIAN_AMD_PACKAGE_DEPENDS ${CPACK_DEBIAN_AMD_PACKAGE_DEPENDS})
206+
string(REPLACE "hip-devel," "" CPACK_RPM_PACKAGE_REQUIRES ${CPACK_RPM_PACKAGE_REQUIRES})
207+
string(REPLACE "hip-devel," "" CPACK_RPM_AMD_PACKAGE_REQUIRES ${CPACK_RPM_AMD_PACKAGE_REQUIRES})
188208
endif()
189209

190210
include(CPack)

0 commit comments

Comments
 (0)