From ebe4e201aac7efa1674b935e8c2e23b692b6e08c Mon Sep 17 00:00:00 2001 From: dovahkiiin Date: Tue, 16 Sep 2025 16:15:32 +0800 Subject: [PATCH] init --- src/torch_atb/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/torch_atb/CMakeLists.txt b/src/torch_atb/CMakeLists.txt index f75429df..85ac8d15 100644 --- a/src/torch_atb/CMakeLists.txt +++ b/src/torch_atb/CMakeLists.txt @@ -11,7 +11,11 @@ file(GLOB_RECURSE pybind11_source_files "*.cpp") pybind11_add_module(_C ${pybind11_source_files}) set_target_properties(_C PROPERTIES OUTPUT_NAME "_C" SUFFIX ".so") -target_link_options(_C PRIVATE -Wno-odr -rdynamic -ldl -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,--build-id=none -fexceptions) +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") + target_compile_options(_C PRIVATE -Wno-odr) + target_link_options(_C PRIVATE -Wno-odr) +endif() +target_link_options(_C PRIVATE -rdynamic -ldl -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,--build-id=none -fexceptions) target_link_libraries(_C PRIVATE torch_npu) target_include_directories(_C PRIVATE ${ATB_INCLUDE_DIR}) install(TARGETS _C DESTINATION ${CMAKE_SOURCE_DIR}/output/torch_atb) \ No newline at end of file -- Gitee