1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-07 06:40:06 +00:00
freebsd-ports/Mk/Features/pie.mk
Jan Beich b40aa97071 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
2024-05-14 10:39:24 +02:00

20 lines
393 B
Makefile

# PIE Support
.if !defined(_PIE_MK_INCLUDED)
_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