Support static lib of comgr
Add "BUILD_SHARED_LIBS" flag to cmake file.
To build libamdhip64.so, you don't need change cmake cmd.
To build libamdhip64.a, you need append
-DBUILD_SHARED_LIBS=OFF
to cmake cmd.
Change-Id: Ibc30ed52963314b2b8cc1df73c360fc1ba15780a
[ROCm/clr commit: 4d67856bed]
This commit is contained in:
@@ -4,6 +4,9 @@ project(ROCclr VERSION "1.0.0" LANGUAGES C CXX)
|
|||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
|
|
||||||
|
#decide whether .so is to be build or .a
|
||||||
|
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared library (.so) or not.")
|
||||||
|
|
||||||
#example command:
|
#example command:
|
||||||
|
|
||||||
#cmake -DOPENCL_DIR=/path to/opencl ..
|
#cmake -DOPENCL_DIR=/path to/opencl ..
|
||||||
@@ -187,7 +190,11 @@ if(USE_COMGR_LIBRARY)
|
|||||||
# FIXME: This should not be part of the public interface. Downstream
|
# FIXME: This should not be part of the public interface. Downstream
|
||||||
# users need to add these definitions. This should be defined in a
|
# users need to add these definitions. This should be defined in a
|
||||||
# config header here so other builds don't need to be aware of this.
|
# config header here so other builds don't need to be aware of this.
|
||||||
target_compile_definitions(amdrocclr_static PUBLIC USE_COMGR_LIBRARY COMGR_DYN_DLL)
|
if(${BUILD_SHARED_LIBS})
|
||||||
|
target_compile_definitions(amdrocclr_static PUBLIC USE_COMGR_LIBRARY COMGR_DYN_DLL)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(amdrocclr_static PUBLIC USE_COMGR_LIBRARY)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(amdrocclr_static PUBLIC Threads::Threads)
|
target_link_libraries(amdrocclr_static PUBLIC Threads::Threads)
|
||||||
|
|||||||
Reference in New Issue
Block a user