Skip to content

Commit

Permalink
Ensure GFlags is compiled with -fPIC
Browse files Browse the repository at this point in the history
GFlags compiled on Ubuntu 18.04 is not linkable by other projects due to
missing `-fPIC` during compilation.

* Add `-DCMAKE_POSITION_INDEPENDENT_CODE=ON` when compiling GFlags.

Signed-off-by: Daniel Llewellyn <daniel@snapcraft.ninja>
  • Loading branch information
Daniel Llewellyn committed Oct 15, 2020
1 parent a1d4cd5 commit 157f931
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions SuperBuild/cmake/External-GFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ExternalProject_Add(${_proj_name}
#--Configure step-------------
SOURCE_DIR ${SB_SOURCE_DIR}/${_proj_name}
CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_INSTALL_PREFIX:PATH=${SB_INSTALL_DIR}
#--Build step-----------------
Expand Down

0 comments on commit 157f931

Please sign in to comment.