Skip to content

Commit

Permalink
Merge pull request #9 from metthal/pic
Browse files Browse the repository at this point in the history
Added option to build position indepdent code
  • Loading branch information
metthal authored Sep 13, 2019
2 parents b3839fd + 27c81c4 commit 41495fd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ option(POG_DOWNLOAD_FMT "Download fmt during build process" OFF)
option(POG_EXAMPLES "Build examples" OFF)
option(POG_TESTS "Build tests" OFF)
option(POG_COVERAGE "Enable coverage" OFF)
option(POG_PIC "Enable position independent code" OFF)

## Includes.
include(CMakePackageConfigHelpers)
Expand Down
1 change: 1 addition & 0 deletions deps/fmt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ExternalProject_Add(
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${FMT_INSTALL_DIR}
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_POSITION_INDEPENDENT_CODE=${POG_PIC}
-DFMT_TEST=OFF
-DFMT_DOC=OFF
BUILD_COMMAND
Expand Down
1 change: 1 addition & 0 deletions deps/re2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ExternalProject_Add(
URL_HASH SHA256=32cd671e526f96ee08ee6227251dc9a54b1fd04d786c1ef2fef8a25c4f0874bf
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${RE2_INSTALL_DIR}
-DCMAKE_POSITION_INDEPENDENT_CODE=${POG_PIC}
-DCMAKE_BUILD_TYPE=Release
-DRE2_BUILD_TESTING=OFF
BUILD_COMMAND
Expand Down
5 changes: 5 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ Other options you can use:
* ``POG_DOWNLOAD_FMT`` - ``fmt`` will be downloaded during build-time. It will be compiled and installed as ``libpog_fmt.a`` (or ``pog_fmt.lib`` on Windows) together with the library. (Default: ``OFF``)
* ``POG_TESTS`` - Build tests located in ``tests/`` folder. (Default: ``OFF``)
* ``POG_EXAMPLES`` - Build examples located in ``examples/`` folder. (Default: ``OFF``)
* ``POG_PIC`` - Build position independent code. (Default: ``OFF``)

.. attention::

Option ``POG_PIC`` does not have any effect if you do not neither of ``POG_DOWNLOAD_RE2`` or ``POG_DOWNLOAD_FMT``. Libraries installed in your system are not guaranteed to be position independent.

Usage
=====
Expand Down

0 comments on commit 41495fd

Please sign in to comment.