summaryrefslogtreecommitdiff
path: root/libs/libaxolotl/src/protobuf-c/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libaxolotl/src/protobuf-c/CMakeLists.txt')
-rw-r--r--libs/libaxolotl/src/protobuf-c/CMakeLists.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/libaxolotl/src/protobuf-c/CMakeLists.txt b/libs/libaxolotl/src/protobuf-c/CMakeLists.txt
index 63f18db8ae..1af25df194 100644
--- a/libs/libaxolotl/src/protobuf-c/CMakeLists.txt
+++ b/libs/libaxolotl/src/protobuf-c/CMakeLists.txt
@@ -3,7 +3,10 @@ IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
ENDIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
IF(CMAKE_COMPILER_IS_GNUCC)
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-sign-compare -Wno-sign-conversion")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-sign-compare")
+ IF(GCC_WARN_SIGN_CONVERSION)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-sign-conversion")
+ ENDIF(GCC_WARN_SIGN_CONVERSION)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF(CMAKE_C_COMPILER_ID MATCHES "Clang")
@@ -15,3 +18,8 @@ set(protobuf_SRCS
)
add_library(protobuf-c OBJECT ${protobuf_SRCS})
+
+# Add -fPIC flag
+if(BUILD_SHARED_LIBS)
+ set_property(TARGET protobuf-c PROPERTY POSITION_INDEPENDENT_CODE ON)
+endif()