Skip to content

Commit 76045bb

Browse files
committed
depends: always set CMAKE_POSITION_INDEPENDENT_CODE=ON
Rather than potentially having to set this per-package, set it globally, as this should always be what we want. Without doing this, changes in later commits will have to add this per-package. Similar to bitcoin/bitcoin#29488, which is the Autotools equivalent.
1 parent d046236 commit 76045bb

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

depends/funcs.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ $(1)_cmake=env CC="$$($(1)_cc)" \
181181
LDFLAGS="$$($(1)_ldflags)" \
182182
cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" \
183183
-DCMAKE_INSTALL_LIBDIR=lib/ \
184+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
184185
$$($(1)_config_opts)
185186
ifeq ($($(1)_type),build)
186187
$(1)_cmake += -DCMAKE_INSTALL_RPATH:PATH="$$($($(1)_type)_prefix)/lib"

depends/packages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ From the [Gentoo Wiki entry](https://wiki.gentoo.org/wiki/Project:Quality_Assura
163163
> ecosystem, as it leads to a massive number of unnecessary rebuilds.
164164
165165
Where possible, packages are built with Position Independant Code. Either using
166-
the autotools `--with-pic` flag, or `DCMAKE_POSITION_INDEPENDENT_CODE` with CMake.
166+
the Autotools `--with-pic` flag, or `CMAKE_POSITION_INDEPENDENT_CODE` with CMake.
167167

168168
## Secondary dependencies:
169169

depends/packages/libmultiprocess.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ $(package)_dependencies += native_capnp
99
endif
1010

1111
define $(package)_set_vars :=
12-
$(package)_config_opts += -DCMAKE_POSITION_INDEPENDENT_CODE=ON
1312
ifneq ($(host),$(build))
1413
$(package)_config_opts := -DCAPNP_EXECUTABLE="$$(native_capnp_prefixbin)/capnp"
1514
$(package)_config_opts += -DCAPNPC_CXX_EXECUTABLE="$$(native_capnp_prefixbin)/capnpc-c++"

0 commit comments

Comments
 (0)