Skip to content

Commit 29f9853

Browse files
committed
Fix cmake config for POSITION_INDEPENDENT_CODE enabling it just when BUILD_SHARED_LIBS is ON
1 parent fa747b1 commit 29f9853

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/lib_json/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ if(BUILD_SHARED_LIBS)
119119
OUTPUT_NAME jsoncpp
120120
VERSION ${PROJECT_VERSION}
121121
SOVERSION ${PROJECT_SOVERSION}
122-
POSITION_INDEPENDENT_CODE ON
122+
POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
123123
)
124124

125125
# Set library's runtime search path on OSX
@@ -180,7 +180,7 @@ if(BUILD_OBJECT_LIBS)
180180
OUTPUT_NAME jsoncpp
181181
VERSION ${PROJECT_VERSION}
182182
SOVERSION ${PROJECT_SOVERSION}
183-
POSITION_INDEPENDENT_CODE ON
183+
POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
184184
)
185185

186186
# Set library's runtime search path on OSX

0 commit comments

Comments
 (0)