提交 509607f5 编写于 作者: M Megvii Engine Team

feat(mge): make cuda stub target as object

GitOrigin-RevId: 0292550eced93d5ff594dfa563c5d6e1809c8f0c
上级 ccd933e6
......@@ -9,11 +9,7 @@ if(MGE_WITH_NVRTC_STUB)
list(APPEND STUB_SRC ${NVRTC_STUB})
endif()
if(MSVC OR WIN32)
add_library(cuda-stub STATIC ${STUB_SRC})
else()
add_library(cuda-stub SHARED ${STUB_SRC})
endif()
add_library(cuda-stub OBJECT ${STUB_SRC})
set_target_properties(cuda-stub PROPERTIES OUTPUT_NAME cuda_stub)
target_compile_definitions(cuda-stub PRIVATE __CUDA_API_VERSION_INTERNAL)
......@@ -24,4 +20,3 @@ else()
endif()
target_include_directories(cuda-stub
PRIVATE $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/genfiles>)
install(TARGETS cuda-stub EXPORT ${MGE_EXPORT_TARGETS})
......@@ -28,8 +28,6 @@ function handle_copy_cuda_libs() {
TO_DIR=$1
if [ ${BUILD_WHL_CPU_ONLY} = "OFF" ]; then
echo "handle cuda lib to ${TO_DIR}"
cp ${BUILD_DIR}/dnn/cuda-stub/libcuda_stub.so ${TO_DIR}
handle_strip ${TO_DIR}/libcuda_stub.so
cp /usr/local/cuda/lib64/libnvToolsExt.so.1 ${TO_DIR}
IFS=: read -a lib_name_array <<<"$CUDA_COPY_LIB_LIST"
append_rpath='$ORIGIN'
......
......@@ -14,6 +14,7 @@ global:
};
megcore*;
*custom*;
cu*;
local:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册