From ec7f9f395afd6b1d69a61ed27000d24f902adf23 Mon Sep 17 00:00:00 2001 From: zhoufeng Date: Sun, 21 Mar 2021 15:25:28 +0800 Subject: [PATCH] fix cmake lint Signed-off-by: zhoufeng --- cmake/dependency_gtest.cmake | 3 ++- cmake/dependency_protobuf.cmake | 6 +++-- cmake/dependency_utils.cmake | 3 ++- cmake/external_libs/flatbuffers.cmake | 7 ++---- cmake/external_libs/grpc.cmake | 13 +++++++---- cmake/external_libs/icu4c.cmake | 8 +++++-- cmake/external_libs/jpeg_turbo.cmake | 6 +++-- cmake/external_libs/libevent.cmake | 3 ++- cmake/external_libs/opencl.cmake | 3 ++- cmake/external_libs/protobuf.cmake | 23 +++++++++++-------- cmake/external_libs/sentencepiece.cmake | 6 +++-- cmake/external_libs/sqlite.cmake | 6 +++-- cmake/external_libs/tvm_predict.cmake | 3 ++- mindspore/ccsrc/common/CMakeLists.txt | 3 ++- .../ccsrc/frontend/operator/CMakeLists.txt | 3 ++- .../ccsrc/frontend/optimizer/CMakeLists.txt | 3 ++- .../ccsrc/runtime/hccl_adapter/CMakeLists.txt | 3 ++- .../ccsrc/transform/express_ir/CMakeLists.txt | 3 ++- .../ccsrc/transform/graph_ir/CMakeLists.txt | 3 ++- .../lite/object_detection/app/CMakeLists.txt | 10 ++++---- 20 files changed, 72 insertions(+), 46 deletions(-) diff --git a/cmake/dependency_gtest.cmake b/cmake/dependency_gtest.cmake index 5d23ddb6c57..7c008cff173 100644 --- a/cmake/dependency_gtest.cmake +++ b/cmake/dependency_gtest.cmake @@ -17,7 +17,8 @@ if(NOT TARGET gtest) set(CMAKE_MACOSX_RPATH TRUE) set(CMAKE_CXX_FLAGS "${SECURE_CXX_FLAGS}") - if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0" AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64" AND SYSTEM_TYPE MATCHES "euleros") + if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0" + AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64" AND SYSTEM_TYPE MATCHES "euleros") # -D_GLIBCXX_USE_CXX11_ABI=0 added for the ABI incompatible for libtsdclient.so # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0") endif() diff --git a/cmake/dependency_protobuf.cmake b/cmake/dependency_protobuf.cmake index c6fd8c7be01..f1f06707a25 100644 --- a/cmake/dependency_protobuf.cmake +++ b/cmake/dependency_protobuf.cmake @@ -86,8 +86,10 @@ function(ms_protobuf_generate_py c_var h_var py_var) COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file} COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file} COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file} - COMMAND perl -pi -e "s/import (.+_pb2.*)/from . import \\1/" "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py" - COMMAND cp "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py" "${PROJECT_SOURCE_DIR}/mindspore/train/" + COMMAND perl -pi -e "s/import (.+_pb2.*)/from . import \\1/" + "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py" + COMMAND cp "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py" + "${PROJECT_SOURCE_DIR}/mindspore/train/" DEPENDS protobuf::protoc ${abs_file} COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM) endforeach() diff --git a/cmake/dependency_utils.cmake b/cmake/dependency_utils.cmake index 6b4f7e9bd61..87b332f84a1 100644 --- a/cmake/dependency_utils.cmake +++ b/cmake/dependency_utils.cmake @@ -17,7 +17,8 @@ function(find_python_package out_inc out_lib) set(${out_inc} ${inc} PARENT_SCOPE) execute_process( - COMMAND "${PYTHON_EXECUTABLE}" -c "import distutils.sysconfig as sysconfig; import os; print(os.path.join(sysconfig.get_config_var('LIBDIR'), sysconfig.get_config_var('LDLIBRARY')))" + COMMAND "${PYTHON_EXECUTABLE}" -c "import distutils.sysconfig as sysconfig; import os; \ + print(os.path.join(sysconfig.get_config_var('LIBDIR'), sysconfig.get_config_var('LDLIBRARY')))" RESULT_VARIABLE result OUTPUT_VARIABLE lib) string(STRIP "${lib}" lib) diff --git a/cmake/external_libs/flatbuffers.cmake b/cmake/external_libs/flatbuffers.cmake index 9f18c8a21bb..2f915b17aba 100644 --- a/cmake/external_libs/flatbuffers.cmake +++ b/cmake/external_libs/flatbuffers.cmake @@ -63,11 +63,8 @@ function(ms_build_flatbuffers source_schema_files endif() endfunction() -function(ms_build_flatbuffers_lite source_schema_files - source_schema_dirs - custom_target_name - generated_output_dir - if_inner) +function(ms_build_flatbuffers_lite + source_schema_files source_schema_dirs custom_target_name generated_output_dir if_inner) set(total_schema_dirs "") set(total_generated_files "") diff --git a/cmake/external_libs/grpc.cmake b/cmake/external_libs/grpc.cmake index a8a618cb483..1a7bc88fb69 100644 --- a/cmake/external_libs/grpc.cmake +++ b/cmake/external_libs/grpc.cmake @@ -1,10 +1,13 @@ set(grpc_USE_STATIC_LIBS ON) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(grpc_CXXFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2") + set(grpc_CXXFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden \ + -D_FORTIFY_SOURCE=2 -O2") elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - set(grpc_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2") + set(grpc_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden \ + -D_FORTIFY_SOURCE=2 -O2") else() - set(grpc_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2") + set(grpc_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden \ + -D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2") endif() set(grpc_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack") @@ -106,7 +109,8 @@ function(ms_grpc_generate c_var h_var) COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/proto" COMMAND protobuf::protoc --version COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/proto - --grpc_out=${CMAKE_BINARY_DIR}/proto --plugin=protoc-gen-grpc=$ ${abs_file} + --grpc_out=${CMAKE_BINARY_DIR}/proto + --plugin=protoc-gen-grpc=$ ${abs_file} DEPENDS protobuf::protoc grpc::grpc_cpp_plugin ${abs_file} COMMENT "Running C++ gRPC compiler on ${file}" VERBATIM) endforeach() @@ -114,5 +118,4 @@ function(ms_grpc_generate c_var h_var) set_source_files_properties(${${c_var}} ${${h_var}} PROPERTIES GENERATED TRUE) set(${c_var} ${${c_var}} PARENT_SCOPE) set(${h_var} ${${h_var}} PARENT_SCOPE) - endfunction() diff --git a/cmake/external_libs/icu4c.cmake b/cmake/external_libs/icu4c.cmake index e14be745507..b872a7c5a05 100644 --- a/cmake/external_libs/icu4c.cmake +++ b/cmake/external_libs/icu4c.cmake @@ -28,7 +28,9 @@ else() URL ${REQ_URL} MD5 ${MD5} PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/icu4c/icu4c.patch01 - CONFIGURE_COMMAND ./icu4c/source/runConfigureICU MacOSX --enable-rpath --disable-tests --disable-samples --disable-icuio --disable-extras ICU_DATA_FILTER_FILE=${CMAKE_BINARY_DIR}/icu4c_filter.json + CONFIGURE_COMMAND ./icu4c/source/runConfigureICU MacOSX --enable-rpath --disable-tests + --disable-samples --disable-icuio --disable-extras + ICU_DATA_FILTER_FILE=${CMAKE_BINARY_DIR}/icu4c_filter.json ) else() mindspore_add_pkg(icu4c @@ -37,7 +39,9 @@ else() URL ${REQ_URL} MD5 ${MD5} PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/icu4c/icu4c.patch01 - CONFIGURE_COMMAND ./icu4c/source/runConfigureICU Linux --enable-rpath --disable-tests --disable-samples --disable-icuio --disable-extras ICU_DATA_FILTER_FILE=${CMAKE_BINARY_DIR}/icu4c_filter.json + CONFIGURE_COMMAND ./icu4c/source/runConfigureICU Linux --enable-rpath --disable-tests --disable-samples + --disable-icuio --disable-extras + ICU_DATA_FILTER_FILE=${CMAKE_BINARY_DIR}/icu4c_filter.json ) endif() include_directories(${icu4c_INC}) diff --git a/cmake/external_libs/jpeg_turbo.cmake b/cmake/external_libs/jpeg_turbo.cmake index ee1811eb336..d55728bba7a 100644 --- a/cmake/external_libs/jpeg_turbo.cmake +++ b/cmake/external_libs/jpeg_turbo.cmake @@ -8,9 +8,11 @@ else() endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(jpeg_turbo_CFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2") + set(jpeg_turbo_CFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 \ + -O2") else() - set(jpeg_turbo_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2") + set(jpeg_turbo_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC \ + -D_FORTIFY_SOURCE=2 -O2") endif() set(jpeg_turbo_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack,-s") diff --git a/cmake/external_libs/libevent.cmake b/cmake/external_libs/libevent.cmake index cc101761904..719634b8e7b 100644 --- a/cmake/external_libs/libevent.cmake +++ b/cmake/external_libs/libevent.cmake @@ -7,7 +7,8 @@ if(ENABLE_GITEE) set(REQ_URL "https://gitee.com/mirrors/libevent/repository/archive/release-2.1.12-stable.tar.gz") set(MD5 "c9036513dd9e5b4fa1c81ade23b7ead2") else() - set(REQ_URL "https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz") + set(REQ_URL + "https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz") set(MD5 "b5333f021f880fe76490d8a799cd79f4") endif() diff --git a/cmake/external_libs/opencl.cmake b/cmake/external_libs/opencl.cmake index 508eac20d97..4c35d7310b7 100644 --- a/cmake/external_libs/opencl.cmake +++ b/cmake/external_libs/opencl.cmake @@ -39,7 +39,8 @@ function(gene_opencl BASEPATH) if(NOT RESULT EQUAL "0") message(FATAL_ERROR "error! when generate ${inc_file_ex}") endif() - __exec_cmd(COMMAND sed -i "1i\\static const char *${kernel_name}_source =\\\"\\\\n\\\" \\\\" ${inc_file_ex} WORKING_DIRECTORY ${CL_SRC_DIR}) + __exec_cmd(COMMAND sed -i "1i\\static const char *${kernel_name}_source =\\\"\\\\n\\\" \\\\" + ${inc_file_ex} WORKING_DIRECTORY ${CL_SRC_DIR}) __exec_cmd(COMMAND sed -i "$a\\\\\;" ${inc_file_ex} WORKING_DIRECTORY ${CL_SRC_DIR}) endforeach() endfunction() diff --git a/cmake/external_libs/protobuf.cmake b/cmake/external_libs/protobuf.cmake index 9abb9ecf604..ab240e1d4f6 100644 --- a/cmake/external_libs/protobuf.cmake +++ b/cmake/external_libs/protobuf.cmake @@ -1,13 +1,17 @@ set(protobuf_USE_STATIC_LIBS ON) if(BUILD_LITE) - set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2") + set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC \ + -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2") else() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2") + set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC \ + -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2") elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2") + set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC \ + -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2") else() - set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2") + set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC \ + -fvisibility=hidden -D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2") endif() endif() @@ -69,7 +73,6 @@ function(ms_protobuf_generate c_var h_var) set_source_files_properties(${${c_var}} ${${h_var}} PROPERTIES GENERATED TRUE) set(${c_var} ${${c_var}} PARENT_SCOPE) set(${h_var} ${${h_var}} PARENT_SCOPE) - endfunction() function(ms_protobuf_generate_py c_var h_var py_var) @@ -100,8 +103,10 @@ function(ms_protobuf_generate_py c_var h_var py_var) COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/proto ${abs_file} COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/proto ${abs_file} COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/proto ${abs_file} - COMMAND perl -pi.bak -e "s/import (.+_pb2.*)/from . import \\1/" "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py" "${PROJECT_SOURCE_DIR}/mindspore/train/" + COMMAND perl -pi.bak -e "s/import (.+_pb2.*)/from . import \\1/" + "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py" + "${PROJECT_SOURCE_DIR}/mindspore/train/" DEPENDS protobuf::protoc ${abs_file} COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM) else() @@ -114,7 +119,8 @@ function(ms_protobuf_generate_py c_var h_var py_var) COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/proto ${abs_file} COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/proto ${abs_file} COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/proto ${abs_file} - COMMAND perl -pi -e "s/import (.+_pb2.*)/from . import \\1/" "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py" + COMMAND perl -pi -e "s/import (.+_pb2.*)/from . import \\1/" + "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py" COMMAND cp "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py" "${PROJECT_SOURCE_DIR}/mindspore/train/" DEPENDS protobuf::protoc ${abs_file} COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM) @@ -124,5 +130,4 @@ function(ms_protobuf_generate_py c_var h_var py_var) set(${c_var} ${${c_var}} PARENT_SCOPE) set(${h_var} ${${h_var}} PARENT_SCOPE) set(${py_var} ${${py_var}} PARENT_SCOPE) - endfunction() diff --git a/cmake/external_libs/sentencepiece.cmake b/cmake/external_libs/sentencepiece.cmake index 204aba10c70..be480197ae4 100644 --- a/cmake/external_libs/sentencepiece.cmake +++ b/cmake/external_libs/sentencepiece.cmake @@ -8,7 +8,8 @@ endif() if(WIN32) - set(sentencepiece_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -Wno-stringop-overflow -Wno-format-extra-args -Wno-format") + set(sentencepiece_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -Wno-stringop-overflow \ + -Wno-format-extra-args -Wno-format") set(sentencepiece_CFLAGS "-D_FORTIFY_SOURCE=2 -O2") mindspore_add_pkg(sentencepiece VER 0.1.92 @@ -24,7 +25,8 @@ else() VER 0.1.92 LIBS sentencepiece sentencepiece_train URL ${REQ_URL} - CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DSPM_USE_BUILTIN_PROTOBUF=OFF -DSPM_ENABLE_SHARED=OFF -DPROTOBUF_INC=${protobuf_INC} + CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DSPM_USE_BUILTIN_PROTOBUF=OFF -DSPM_ENABLE_SHARED=OFF + -DPROTOBUF_INC=${protobuf_INC} MD5 ${MD5} PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/sentencepiece/sentencepiece.patch001 ) diff --git a/cmake/external_libs/sqlite.cmake b/cmake/external_libs/sqlite.cmake index fc434bcdb4d..185fe05620c 100644 --- a/cmake/external_libs/sqlite.cmake +++ b/cmake/external_libs/sqlite.cmake @@ -21,9 +21,11 @@ else() set(sqlite_USE_STATIC_LIBS ON) set(sqlite_CXXFLAGS) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(sqlite_CFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2") + set(sqlite_CFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 \ + -O2") else() - set(sqlite_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2") + set(sqlite_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC \ + -D_FORTIFY_SOURCE=2 -O2") set(sqlite_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack") endif() mindspore_add_pkg(sqlite diff --git a/cmake/external_libs/tvm_predict.cmake b/cmake/external_libs/tvm_predict.cmake index 92936e4d892..299f1fb09f1 100644 --- a/cmake/external_libs/tvm_predict.cmake +++ b/cmake/external_libs/tvm_predict.cmake @@ -2,7 +2,8 @@ if(ENABLE_GITEE) set(REQ_URL "https://gitee.com/mirrors/incubator-tvm/repository/archive/v0.6.0.tar.gz") set(MD5 "7b22965745cf1c6208a4e367fb86a585") else() - set(REQ_URL "https://github.com/apache/incubator-tvm/release/download/v0.6.0/apache-tvm-src-v0.6.0-incubating.tar.gz") + set(REQ_URL + "https://github.com/apache/incubator-tvm/release/download/v0.6.0/apache-tvm-src-v0.6.0-incubating.tar.gz") set(MD5 "2d77a005f0046d937b99c67de82f6438") endif() set(incubator_tvm_predict_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2") diff --git a/mindspore/ccsrc/common/CMakeLists.txt b/mindspore/ccsrc/common/CMakeLists.txt index 28e2d1e9061..8830b34dca0 100644 --- a/mindspore/ccsrc/common/CMakeLists.txt +++ b/mindspore/ccsrc/common/CMakeLists.txt @@ -14,5 +14,6 @@ else() ) endif() -set_property(SOURCE ${_COMMON_ALL_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_COMMON) +set_property(SOURCE ${_COMMON_ALL_SRC_FILES} PROPERTY COMPILE_DEFINITIONS + SUBMODULE_ID=mindspore::SubModuleId::SM_COMMON) add_library(_mindspore_common_obj OBJECT ${_COMMON_ALL_SRC_FILES}) diff --git a/mindspore/ccsrc/frontend/operator/CMakeLists.txt b/mindspore/ccsrc/frontend/operator/CMakeLists.txt index 0b6dd77c690..4ac71811b7a 100644 --- a/mindspore/ccsrc/frontend/operator/CMakeLists.txt +++ b/mindspore/ccsrc/frontend/operator/CMakeLists.txt @@ -1,3 +1,4 @@ file(GLOB_RECURSE _OPERATOR_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc") -set_property(SOURCE ${_OPERATOR_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_ANALYZER) +set_property(SOURCE ${_OPERATOR_SRC_FILES} PROPERTY COMPILE_DEFINITIONS + SUBMODULE_ID=mindspore::SubModuleId::SM_ANALYZER) add_library(_mindspore_frontend_operator_obj OBJECT ${_OPERATOR_SRC_FILES}) diff --git a/mindspore/ccsrc/frontend/optimizer/CMakeLists.txt b/mindspore/ccsrc/frontend/optimizer/CMakeLists.txt index 6c112482f58..f4d0eb29be9 100644 --- a/mindspore/ccsrc/frontend/optimizer/CMakeLists.txt +++ b/mindspore/ccsrc/frontend/optimizer/CMakeLists.txt @@ -4,5 +4,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-delete-non-abstract-non-virtual-dtor") endif() -set_property(SOURCE ${_OPTIMIZER_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_OPTIMIZER) +set_property(SOURCE ${_OPTIMIZER_SRC_FILES} PROPERTY COMPILE_DEFINITIONS + SUBMODULE_ID=mindspore::SubModuleId::SM_OPTIMIZER) add_library(_mindspore_frontend_optimizer_obj OBJECT ${_OPTIMIZER_SRC_FILES}) diff --git a/mindspore/ccsrc/runtime/hccl_adapter/CMakeLists.txt b/mindspore/ccsrc/runtime/hccl_adapter/CMakeLists.txt index 8538fca9e30..8f7f421ed43 100644 --- a/mindspore/ccsrc/runtime/hccl_adapter/CMakeLists.txt +++ b/mindspore/ccsrc/runtime/hccl_adapter/CMakeLists.txt @@ -1,5 +1,6 @@ file(GLOB_RECURSE HCCL_ADAPTER_SRC_LIST ./*.cc) -set_property(SOURCE ${HCCL_ADAPTER_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_HCCL_ADPT) +set_property(SOURCE ${HCCL_ADAPTER_SRC_LIST} PROPERTY COMPILE_DEFINITIONS + SUBMODULE_ID=mindspore::SubModuleId::SM_HCCL_ADPT) if(ENABLE_D) add_library(_mindspore_runtime_hccl_adapter_obj OBJECT ${HCCL_ADAPTER_SRC_LIST}) target_include_directories(_mindspore_runtime_hccl_adapter_obj PRIVATE ${CMAKE_BINARY_DIR}/proto/ge) diff --git a/mindspore/ccsrc/transform/express_ir/CMakeLists.txt b/mindspore/ccsrc/transform/express_ir/CMakeLists.txt index 05afdd0f60d..72e035ffe61 100644 --- a/mindspore/ccsrc/transform/express_ir/CMakeLists.txt +++ b/mindspore/ccsrc/transform/express_ir/CMakeLists.txt @@ -1,3 +1,4 @@ file(GLOB_RECURSE _EXPORTER_IR_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc") -set_property(SOURCE ${_EXPORTER_IR_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_EXPRESS) +set_property(SOURCE ${_EXPORTER_IR_SRC_FILES} PROPERTY COMPILE_DEFINITIONS + SUBMODULE_ID=mindspore::SubModuleId::SM_EXPRESS) add_library(_mindspore_transform_express_ir_obj OBJECT ${_EXPORTER_IR_SRC_FILES}) \ No newline at end of file diff --git a/mindspore/ccsrc/transform/graph_ir/CMakeLists.txt b/mindspore/ccsrc/transform/graph_ir/CMakeLists.txt index c660738f255..4da4c6f833b 100644 --- a/mindspore/ccsrc/transform/graph_ir/CMakeLists.txt +++ b/mindspore/ccsrc/transform/graph_ir/CMakeLists.txt @@ -1,7 +1,8 @@ if(ENABLE_GE OR ENABLE_D OR ENABLE_ACL) file(GLOB_RECURSE _TRANSFORM_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc") list(REMOVE_ITEM _TRANSFORM_SRC_LIST "graph_ir/op_declare/hcom_ops_declare.cc") - set_property(SOURCE ${_TRANSFORM_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_GE_ADPT) + set_property(SOURCE ${_TRANSFORM_SRC_LIST} PROPERTY COMPILE_DEFINITIONS + SUBMODULE_ID=mindspore::SubModuleId::SM_GE_ADPT) add_library(_mindspore_transform_graph_ir_obj OBJECT ${_TRANSFORM_SRC_LIST}) if(NOT ENABLE_GE) diff --git a/model_zoo/official/lite/object_detection/app/CMakeLists.txt b/model_zoo/official/lite/object_detection/app/CMakeLists.txt index a3c137ac262..96ad3dcdd32 100644 --- a/model_zoo/official/lite/object_detection/app/CMakeLists.txt +++ b/model_zoo/official/lite/object_detection/app/CMakeLists.txt @@ -57,12 +57,10 @@ add_library( # Sets the name of the library. # you want to add. CMake verifies that the library exists before # completing its build. -find_library( # Sets the name of the path variable. - log-lib - - # Specifies the name of the NDK library that - # you want CMake to locate. - log ) +# Sets the name of the path variable. +# Specifies the name of the NDK library that +# you want CMake to locate. +find_library(log-lib log) find_library( jnigraphics-lib jnig·raphics )