aboutsummaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2024-05-14 08:35:00 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2024-05-14 08:39:24 +0000
commitb40aa97071012f71a9c8937ef41d3153f070243f (patch)
tree6fb37dc2342d3513d0d1e24b605f8ea86ac5ab4a /Mk
parent410711a4baa10174d81bbbf647e04e76b5e64a86 (diff)
downloadports-b40aa97071012f71a9c8937ef41d3153f070243f.tar.gz
ports-b40aa97071012f71a9c8937ef41d3153f070243f.zip
Mk/Features: WITH_PIE - add cmake support
Use cmake specific options to enable position independent code generation. This fixes several ports (at least multimedia/cmrtlib, math/blas and math/lapack) which are build with cmake when WITH_PIE is enabled. PR: 268981 Approved by: portmgr
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Features/pie.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/Mk/Features/pie.mk b/Mk/Features/pie.mk
index 2f7b902f2660..06174b403c31 100644
--- a/Mk/Features/pie.mk
+++ b/Mk/Features/pie.mk
@@ -5,11 +5,15 @@ _PIE_MK_INCLUDED= yes
PIE_Include_MAINTAINER= portmgr@FreeBSD.org
. if !defined(PIE_UNSAFE)
+. if defined(_INCLUDE_USES_CMAKE_MK)
+CMAKE_ARGS+= -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true
+. else
PIE_CFLAGS?= -fPIE -fPIC
CFLAGS+= ${PIE_CFLAGS}
CXXFLAGS+= ${PIE_CFLAGS}
LDFLAGS+= -pie
STATIC_PIE_ARGS+= -static-pie
+. endif
. endif
.endif