Browse Source

Enable core api exporting in Windows

tags/v1.5.0-rc1
He Wei 4 years ago
parent
commit
06626aaac2
4 changed files with 8 additions and 4 deletions
  1. +1
    -1
      build.bat
  2. +1
    -0
      mindspore/ccsrc/minddata/dataset/CMakeLists.txt
  3. +4
    -0
      mindspore/core/mindrt/CMakeLists.txt
  4. +2
    -3
      mindspore/core/utils/visible.h

+ 1
- 1
build.bat View File

@@ -18,7 +18,7 @@
SET BASE_PATH=%CD%
SET BUILD_PATH=%BASE_PATH%/build

SET threads=6
SET threads=8
SET ENABLE_GITEE=OFF

set VERSION_MAJOR=''


+ 1
- 0
mindspore/ccsrc/minddata/dataset/CMakeLists.txt View File

@@ -267,6 +267,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
else()
target_link_libraries(_c_dataengine PRIVATE ${SECUREC_LIBRARY})
endif()
target_link_options(_c_dataengine PRIVATE -Wl,--allow-multiple-definition)
else()
set(ICU_LIB mindspore::icuuc mindspore::icudata mindspore::icui18n)
if(ENABLE_PYTHON)


+ 4
- 0
mindspore/core/mindrt/CMakeLists.txt View File

@@ -11,4 +11,8 @@ file(GLOB MINDRT_SRC
${CMAKE_CURRENT_SOURCE_DIR}/src/thread/*.cc
)

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
add_compile_definitions(BUILDING_DLL)
endif()

add_library(mindrt_mid OBJECT ${MINDRT_SRC})

+ 2
- 3
mindspore/core/utils/visible.h View File

@@ -18,12 +18,11 @@
#define MINDSPORE_CORE_UTILS_VISIBLE_H_

#if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__))
// Because it extremely slow down compile time in mingw,
// core api exporting is disabled for Windows.
#define MS_CORE_API
#ifdef BUILDING_DLL
#define MS_CORE_API __declspec(dllexport)
#define MS_EXPORT __declspec(dllexport)
#else
#define MS_CORE_API __declspec(dllimport)
#define MS_EXPORT __declspec(dllimport)
#endif
#define MS_LOCAL


Loading…
Cancel
Save