From 203d3e0d40075e577fc07c60c00cfa5ab129b856 Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Tue, 20 Feb 2024 16:11:00 +0100 Subject: [PATCH] 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 --- .../cmake/platform/platform_unix.cmake | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index 51043c41acd..f039cff72ea 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -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})