From a14b51df924cbdd915f46571b396d6b9ac6e84ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 23 Apr 2021 10:25:51 +0200 Subject: [PATCH] Linux: Don't attempt linking embree3 on non-tools, link it for headless too `tech_debt++`, that's what we get for not taking the time to cleanup all this and do it right... Follow-up to #48073 and #48102. --- platform/server/detect.py | 7 +++++++ platform/x11/detect.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/server/detect.py b/platform/server/detect.py index 59eb3dc5cbc..49fbdedd3f4 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -222,6 +222,13 @@ def configure(env): if not env["builtin_pcre2"]: env.ParseConfig("pkg-config libpcre2-32 --cflags --libs") + # Embree is only compatible with x86_64. Yet another unreliable hack that will break + # cross-compilation, this will really need to be handle better. Thankfully only affects + # people who disable builtin_embree (likely distro packagers). + if env["tools"] and not env["builtin_embree"] and (is64 and platform.machine() == "x86_64"): + # No pkgconfig file so far, hardcode expected lib name. + env.Append(LIBS=["embree3"]) + ## Flags # Linkflags below this line should typically stay the last ones diff --git a/platform/x11/detect.py b/platform/x11/detect.py index ada0669a69c..1a520441509 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -313,7 +313,7 @@ def configure(env): # Embree is only compatible with x86_64. Yet another unreliable hack that will break # cross-compilation, this will really need to be handle better. Thankfully only affects # people who disable builtin_embree (likely distro packagers). - if not env["builtin_embree"] and (is64 and platform.machine() == "x86_64"): + if env["tools"] and not env["builtin_embree"] and (is64 and platform.machine() == "x86_64"): # No pkgconfig file so far, hardcode expected lib name. env.Append(LIBS=["embree3"])