From 6328edf455bd28ca3fd6bf90d19059c6cc4a54e2 Mon Sep 17 00:00:00 2001 From: panfengfeng Date: Wed, 22 Apr 2020 16:27:35 +0800 Subject: [PATCH] modify dataset & mindrecord log compile --- mindspore/ccsrc/dataset/CMakeLists.txt | 8 ++++++-- mindspore/ccsrc/mindrecord/CMakeLists.txt | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/dataset/CMakeLists.txt b/mindspore/ccsrc/dataset/CMakeLists.txt index 879a9346bc..dc93d18a28 100644 --- a/mindspore/ccsrc/dataset/CMakeLists.txt +++ b/mindspore/ccsrc/dataset/CMakeLists.txt @@ -71,7 +71,6 @@ else () add_library(_c_dataengine SHARED ${submodules}) endif () - set_target_properties(_c_dataengine PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}" SUFFIX "${PYTHON_MODULE_EXTENSION}" @@ -110,5 +109,10 @@ endif() if (USE_GLOG) target_link_libraries(_c_dataengine PRIVATE mindspore::glog) +else() + if (CMAKE_SYSTEM_NAME MATCHES "Linux") + target_link_options(_c_dataengine PRIVATE -Wl,-init,mindspore_log_init) + elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") + set_target_properties(_c_dataengine PROPERTIES MACOSX_RPATH ON) + endif () endif() - diff --git a/mindspore/ccsrc/mindrecord/CMakeLists.txt b/mindspore/ccsrc/mindrecord/CMakeLists.txt index fdd648a50f..f523eae569 100644 --- a/mindspore/ccsrc/mindrecord/CMakeLists.txt +++ b/mindspore/ccsrc/mindrecord/CMakeLists.txt @@ -34,4 +34,10 @@ endif() if (USE_GLOG) target_link_libraries(_c_mindrecord PRIVATE mindspore::glog) +else() + if (CMAKE_SYSTEM_NAME MATCHES "Linux") + target_link_options(_c_mindrecord PRIVATE -Wl,-init,mindspore_log_init) + elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") + set_target_properties(_c_mindrecord PROPERTIES MACOSX_RPATH ON) + endif () endif()