Skip to content

Commit

Permalink
Fix building static libs
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed May 24, 2021
1 parent 8ee2236 commit 5a23e27
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/spatialindex/capi/sidx_export.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#pragma once

#ifndef SIDX_C_DLL
#if defined(_MSC_VER)
#if defined(_MSC_VER) && defined(SIDX_DLL_EXPORT)
# define SIDX_C_DLL __declspec(dllexport)
# define SIDX_DLL __declspec(dllexport)
#else
Expand Down
2 changes: 1 addition & 1 deletion include/spatialindex/tools/Tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#ifdef SIDX_DLL_EXPORT
#define SIDX_DLL __declspec(dllexport)
#else
#define SIDX_DLL __declspec(dllimport)
#define SIDX_DLL
#endif

// Nuke this annoying warning. See http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html
Expand Down
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ set(SIDX_SOURCES
${SIDX_CPP})

add_library(spatialindex ${SIDX_SOURCES})

add_library(spatialindex_c ${SIDX_CAPI_CPP})

target_link_libraries(spatialindex_c spatialindex)
Expand All @@ -204,9 +203,10 @@ if(MSVC)
target_compile_options(spatialindex PRIVATE /wd4068)
target_compile_options(spatialindex_c PRIVATE /wd4068)

target_compile_definitions(spatialindex_c PRIVATE -DSIDX_DLL_EXPORT=1)
target_compile_definitions(spatialindex PRIVATE -DSIDX_DLL_EXPORT=1)
if(NOT WITH_STATIC_SIDX)
if (BUILD_SHARED_LIBS)
target_compile_definitions(spatialindex PRIVATE -DSIDX_DLL_EXPORT=1)
target_compile_definitions(spatialindex_c PRIVATE -DSIDX_DLL_EXPORT=1)
else()
target_compile_definitions(spatialindex PRIVATE -DSIDX_DLL_IMPORT=1)
target_compile_definitions(spatialindex_c PRIVATE -DSIDX_DLL_IMPORT=1)
endif()
Expand Down

0 comments on commit 5a23e27

Please sign in to comment.