Adding "BUILD_SHARED_LIBS" flag to cmake files

JIRA : SWDEV-234471
With this change compilation of the ibamdhip64 to be decied by arguments to build_hip_on_rocclr.sh file
build_hip_on_rocclr.sh -r (current) shall conitnue to create libamdhip64.so;
build_hip_on_rocclr.sh -r a (new) shall create libamdhip64.a
other options remain the same

Changed the targets according to requirement of stage2 dependencies.
Changed find_lib with find_package

Adpated the review comments

Change-Id: I719918f73ab33cd8031a32db6fe9b8adaa1b4b87


[ROCm/hip commit: ab88cbbb8a]
This commit is contained in:
Ashutosh Mishra
2020-06-03 23:00:36 +05:30
committed by Ashutosh Mishra
parent 877f2904a9
commit 1065f6333d
5 changed files with 82 additions and 44 deletions
+8 -3
View File
@@ -23,9 +23,14 @@ set_target_properties(
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
target_include_directories(ca SYSTEM PUBLIC ${HSA_PATH}/include)
target_include_directories(ca PUBLIC ${PROJECT_SOURCE_DIR}/src)
find_library(
hsart NAMES libhsa-runtime64.so libhsa-runtime64.so.1 HINTS ${HSA_PATH}/lib)
target_link_libraries(ca PUBLIC ${hsart})
find_package(hsa-runtime64 REQUIRED CONFIG
PATHS
/opt/rocm/
PATH_SUFFIXES
cmake/hsa-runtime64)
target_link_libraries(ca PUBLIC hsa-runtime64::hsa-runtime64 )
target_compile_options(ca PUBLIC -DDISABLE_REDUCED_GPU_BLOB_COPY -Wall)
install(TARGETS ca RUNTIME DESTINATION bin)