CMake/deps: Append platform CFLAGS and LDFLAGS to Python build to ensure compatibility with minimum macOS version

Similarly to other dependencies, the Python build should make use of the default CMake arguments. On macOS, for example, these arguments are required to set the deployment target correctly.

See also: https://devtalk.blender.org/t/compiling-latest-branch-on-macos-fails-undefined-symbol/17649

Reviewed By: brecht, sybren

Differential Revision: https://developer.blender.org/D10498
This commit is contained in:
Sebastián Barschkis 2021-03-01 20:05:37 +01:00
parent 6471cf6bc8
commit 81c770944c
1 changed files with 2 additions and 2 deletions

View File

@ -81,8 +81,8 @@ else()
# Link against zlib statically (Unix). Avoid rpath issues (macOS).
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_unix.diff)
set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl")
set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include")
set(PYTHON_LDFLAGS "-L${LIBDIR}/ffi/lib -L${LIBDIR}/sqlite/lib -L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib")
set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include ${PLATFORM_CFLAGS}")
set(PYTHON_LDFLAGS "-L${LIBDIR}/ffi/lib -L${LIBDIR}/sqlite/lib -L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib ${PLATFORM_LDFLAGS}")
set(PYTHON_CONFIGURE_EXTRA_ENV
export CFLAGS=${PYTHON_CFLAGS} &&
export CPPFLAGS=${PYTHON_CFLAGS} &&