From 6e9b324ab7bf5909df7e68409e060282db14fa54 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 23 Oct 2021 16:17:36 +0200 Subject: CMake: revise how we deal with symbol export and static builds - Remove the explicit PROJ_MSVC_DLL_IMPORT symbol used for importing symbols from a MSVC .dll: by default on MSVC, we use now __declspec(dllimport), unless PROJ_MSVC_DLL_EXPORT is defined by PROJ at build time. This makes it easier for users: they don't have to define anything special. This simplifies in particular the build of our binaries - For static builds, export -DPROJ_DLL= as public, so that users that import PROJ through CMake mechanism don't have to do it manually. --- src/bin_geod.cmake | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/bin_geod.cmake') diff --git a/src/bin_geod.cmake b/src/bin_geod.cmake index 3f3f9bf5..6f081634 100644 --- a/src/bin_geod.cmake +++ b/src/bin_geod.cmake @@ -15,10 +15,6 @@ target_compile_options(geod PRIVATE ${PROJ_CXX_WARN_FLAGS}) install(TARGETS geod DESTINATION ${BINDIR}) -if(MSVC AND BUILD_SHARED_LIBS) - target_compile_definitions(geod PRIVATE PROJ_MSVC_DLL_IMPORT=1) -endif() - # invgeod target: symlink or copy of geod executable if(UNIX) @@ -48,8 +44,4 @@ else() install(TARGETS invgeod DESTINATION ${BINDIR}) - if(MSVC AND BUILD_SHARED_LIBS) - target_compile_definitions(invgeod PRIVATE PROJ_MSVC_DLL_IMPORT=1) - endif() - endif() -- cgit v1.2.3