GMP/macOS: silence "PIE disabled" linker warning.

The change builds GMP with `--with-pic` flag on non-arm architecture.

The warning:
ld: warning: PIE disabled. Absolute addressing
(perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in
___gmpn_divexact_1 from lib/darwin/gmp/lib/libgmp.a(dive_1.o). To fix
this warning, don't compile with -mdynamic-no-pic or link with
-Wl,-no_pie

Reviewed By: sebbas

Differential Revision: https://developer.blender.org/D8823
This commit is contained in:
Ankit 2020-09-16 02:02:45 +05:30 committed by Ankit Meel
parent 8aab26b3b3
commit 84032fd110
1 changed files with 12 additions and 5 deletions

View File

@ -25,11 +25,18 @@ else()
set(GMP_OPTIONS --enable-static --disable-shared )
endif()
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
set(GMP_OPTIONS
${GMP_OPTIONS}
--disable-assembly
)
if(APPLE)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(GMP_OPTIONS
${GMP_OPTIONS}
--disable-assembly
)
else()
set(GMP_OPTIONS
${GMP_OPTIONS}
--with-pic
)
endif()
endif()
ExternalProject_Add(external_gmp