aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-12-11 23:08:50 +0100
committerGitHub <noreply@github.com>2019-12-11 23:08:50 +0100
commit5b4e60f4f9ec353f79fba01790a3b945c50cab8e (patch)
tree229d92d63d6668afee7fbc8274aac27e05a9b871 /src
parent28d61f5ee6dfaf7b2f68dc922c4ff7202427a5d7 (diff)
parent8ae7e0d2b6e853432ce988fea62527240c529871 (diff)
downloadPROJ-5b4e60f4f9ec353f79fba01790a3b945c50cab8e.tar.gz
PROJ-5b4e60f4f9ec353f79fba01790a3b945c50cab8e.zip
Merge pull request #1773 from orudge/msvc-no-static-exports
Build: Only export symbols if building DLL
Diffstat (limited to 'src')
-rw-r--r--src/geodesic.h2
-rw-r--r--src/lib_proj.cmake2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/geodesic.h b/src/geodesic.h
index 5d230531..e2265c89 100644
--- a/src/geodesic.h
+++ b/src/geodesic.h
@@ -158,7 +158,7 @@
GEODESIC_VERSION_PATCH)
#if !defined(GEOD_DLL)
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && defined(PROJ_MSVC_DLL_EXPORT)
#define GEOD_DLL __declspec(dllexport)
#elif defined(__GNUC__)
#define GEOD_DLL __attribute__ ((visibility("default")))
diff --git a/src/lib_proj.cmake b/src/lib_proj.cmake
index d1bc8836..bc27bafe 100644
--- a/src/lib_proj.cmake
+++ b/src/lib_proj.cmake
@@ -443,7 +443,7 @@ endif()
include_directories(${SQLITE3_INCLUDE_DIR})
target_link_libraries(${PROJ_CORE_TARGET} ${SQLITE3_LIBRARY})
-if(MSVC)
+if(MSVC AND BUILD_LIBPROJ_SHARED)
target_compile_definitions(${PROJ_CORE_TARGET}
PRIVATE PROJ_MSVC_DLL_EXPORT=1)
endif()