From c81c2e80daf633bf2bab8fd43300e0dbfa9460a9 Mon Sep 17 00:00:00 2001 From: chenyemeng Date: Wed, 30 Dec 2020 14:11:29 +0800 Subject: [PATCH] add macro --- ge/CMakeLists.txt | 1 + ge/common/CMakeLists.txt | 2 ++ ge/ge_local_engine/CMakeLists.txt | 5 +++++ ge/ge_runtime/CMakeLists.txt | 1 + ge/graph/build/memory/CMakeLists.txt | 1 + ge/host_cpu_engine/CMakeLists.txt | 5 +++++ ge/plugin/engine/CMakeLists.txt | 1 + 7 files changed, 16 insertions(+) diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index 306b3eda..0325a7de 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -768,6 +768,7 @@ add_library(opensrc_ascendcl SHARED target_compile_definitions(opensrc_ascendcl PRIVATE google=ascend_private + $<$:ONLY_COMPILE_OPEN_SRC> ) target_compile_options(opensrc_ascendcl PRIVATE diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index 1598ffd5..d2b8c8e7 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -133,6 +133,7 @@ target_compile_definitions(ge_common_static PRIVATE $,OS_TYPE=WIN,OS_TYPE=0> $<$:SECUREC_USING_STD_SECURE_LIB=0 NOMINMAX> LOG_CPP + $<$:ONLY_COMPILE_OPEN_SRC> ) target_compile_options(ge_common_static PRIVATE @@ -181,6 +182,7 @@ target_compile_definitions(ge_common PRIVATE FMK_SUPPORT_DUMP OS_CENTOS google=ascend_private + $<$:ONLY_COMPILE_OPEN_SRC> ) target_compile_options(ge_common PRIVATE diff --git a/ge/ge_local_engine/CMakeLists.txt b/ge/ge_local_engine/CMakeLists.txt index 7189e8ff..f963730b 100755 --- a/ge/ge_local_engine/CMakeLists.txt +++ b/ge/ge_local_engine/CMakeLists.txt @@ -31,6 +31,7 @@ target_compile_options(ge_local_engine PRIVATE target_compile_definitions(ge_local_engine PRIVATE google=ascend_private + $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(ge_local_engine PRIVATE @@ -72,6 +73,7 @@ target_compile_options(atc_ge_local_engine PRIVATE target_compile_definitions(atc_ge_local_engine PRIVATE COMPILE_OMG_PACKAGE google=ascend_private + $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(atc_ge_local_engine PRIVATE @@ -117,6 +119,7 @@ target_compile_options(ge_local_opskernel_builder PRIVATE target_compile_definitions(ge_local_opskernel_builder PRIVATE google=ascend_private + $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(ge_local_opskernel_builder PRIVATE @@ -158,6 +161,7 @@ target_compile_options(atc_ge_local_opskernel_builder PRIVATE target_compile_definitions(atc_ge_local_opskernel_builder PRIVATE google=ascend_private + $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(atc_ge_local_opskernel_builder PRIVATE @@ -205,6 +209,7 @@ target_compile_options(ge_local_opskernel_builder_static PRIVATE target_compile_definitions(ge_local_opskernel_builder_static PRIVATE google=ascend_private LOG_CPP + $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(ge_local_opskernel_builder_static PRIVATE diff --git a/ge/ge_runtime/CMakeLists.txt b/ge/ge_runtime/CMakeLists.txt index ce1b89ea..ca770b15 100644 --- a/ge/ge_runtime/CMakeLists.txt +++ b/ge/ge_runtime/CMakeLists.txt @@ -27,6 +27,7 @@ target_compile_options(ge_runtime PRIVATE target_compile_definitions(ge_runtime PRIVATE PROTOBUF_INLINE_NOT_IN_HEADERS=0 + $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(ge_runtime PRIVATE diff --git a/ge/graph/build/memory/CMakeLists.txt b/ge/graph/build/memory/CMakeLists.txt index 126e0187..f6f56a54 100644 --- a/ge/graph/build/memory/CMakeLists.txt +++ b/ge/graph/build/memory/CMakeLists.txt @@ -20,6 +20,7 @@ target_compile_options(ge_memory PRIVATE target_compile_definitions(ge_memory PRIVATE google=ascend_private LOG_CPP + $<$:ONLY_COMPILE_OPEN_SRC> ) target_link_libraries(ge_memory PRIVATE diff --git a/ge/host_cpu_engine/CMakeLists.txt b/ge/host_cpu_engine/CMakeLists.txt index cbd0bd8b..f20f810e 100644 --- a/ge/host_cpu_engine/CMakeLists.txt +++ b/ge/host_cpu_engine/CMakeLists.txt @@ -25,6 +25,7 @@ target_compile_options(host_cpu_engine PRIVATE target_compile_definitions(host_cpu_engine PRIVATE google=ascend_private + $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(host_cpu_engine PRIVATE @@ -65,6 +66,7 @@ target_compile_options(atc_host_cpu_engine PRIVATE target_compile_definitions(atc_host_cpu_engine PRIVATE COMPILE_OMG_PACKAGE google=ascend_private + $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(atc_host_cpu_engine PRIVATE @@ -109,6 +111,7 @@ target_compile_options(host_cpu_opskernel_builder PRIVATE target_compile_definitions(host_cpu_opskernel_builder PRIVATE google=ascend_private + $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(host_cpu_opskernel_builder PRIVATE @@ -149,6 +152,7 @@ target_compile_options(atc_host_cpu_opskernel_builder PRIVATE target_compile_definitions(atc_host_cpu_opskernel_builder PRIVATE google=ascend_private + $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(atc_host_cpu_opskernel_builder PRIVATE @@ -195,6 +199,7 @@ target_compile_options(host_cpu_opskernel_builder_static PRIVATE target_compile_definitions(host_cpu_opskernel_builder_static PRIVATE google=ascend_private LOG_CPP + $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(host_cpu_opskernel_builder_static PRIVATE diff --git a/ge/plugin/engine/CMakeLists.txt b/ge/plugin/engine/CMakeLists.txt index f6353231..65d5a8a1 100644 --- a/ge/plugin/engine/CMakeLists.txt +++ b/ge/plugin/engine/CMakeLists.txt @@ -14,6 +14,7 @@ target_compile_options(engine PRIVATE target_compile_definitions(engine PRIVATE REUSE_MEMORY=1 PROTOBUF_INLINE_NOT_IN_HEADERS=0 + $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(engine PRIVATE