Linux: Don't always enable the CPU checker

When building a non portable build or when not using the precompiled
libraries, do not enable the CPU checker.

Make the cmake configure step error out when building with
WITH_STRICT_BUILD_OPTIONS if the LIBDIR can not be found.

Pull Request: https://projects.blender.org/blender/blender/pulls/118519
This commit is contained in:
Sebastian Parborg 2024-02-20 16:11:00 +01:00 committed by Gitea
parent 43f45f3986
commit 203d3e0d40
1 changed files with 20 additions and 4 deletions

View File

@ -38,14 +38,30 @@ else()
endif()
if(NOT (EXISTS ${LIBDIR}))
message(STATUS
"Unable to find LIBDIR: ${LIBDIR}, system libraries may be used "
"(disable WITH_LIBS_PRECOMPILED to suppress this message)."
)
if(WITH_STRICT_BUILD_OPTIONS)
message(SEND_ERROR
"Unable to find LIBDIR: ${LIBDIR}. "
"WITH_LIBS_PRECOMPILED needs to be able to find the LIBDIR for the precompiled libraries."
)
else()
message(STATUS
"Unable to find LIBDIR: ${LIBDIR}. system libraries may be used "
"(disable WITH_LIBS_PRECOMPILED to suppress this message)."
)
endif()
unset(LIBDIR)
set(WITH_LIBS_PRECOMPILED OFF)
endif()
endif()
# Disable the CPU check if not portable or if we are not using the pre-compiled libs.
# This is because:
# 1. We don't install the CPU check library on a non portable build.
# 2. We assume that people know what systems they are targeting when they build a non
# portable build or when not using our precompiled libs.
set_and_warn_dependency(WITH_INSTALL_PORTABLE WITH_CPU_CHECK OFF)
set_and_warn_dependency(WITH_LIBS_PRECOMPILED WITH_CPU_CHECK OFF)
# Support restoring this value once pre-compiled libraries have been handled.
set(WITH_STATIC_LIBS_INIT ${WITH_STATIC_LIBS})