Skip to content

Commit

Permalink
Compile static build with position independent code
Browse files Browse the repository at this point in the history
  • Loading branch information
taylor-a-barnes committed Jan 7, 2025
1 parent 8ccf429 commit a1e0a80
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions MDI_Library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ endif()
if ( libtype STREQUAL "SHARED" )
set(BUILD_SHARED_LIBS ON)
endif()
if ( NOT libtype )
set(BUILD_SHARED_LIBS ON)
endif()
if (BUILD_SHARED_LIBS)
set(mdi_STATIC_BUILD OFF)
else()
Expand All @@ -76,6 +73,11 @@ add_library(mdi)
target_sources(mdi
PRIVATE ${sources})

# If this is a static library, should compile with position independent code
if ( mdi_STATIC_BUILD )
set_target_properties(mdi PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()

# Set API version of MDI Library
set_target_properties(mdi PROPERTIES SOVERSION 1) # bump whenever interface has changes or removals

Expand Down

0 comments on commit a1e0a80

Please sign in to comment.