From ca8f19baeabdbe640dc49204653aa41c7ff29b80 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 10 Dec 2024 11:39:56 +0100 Subject: [PATCH] Update Clang profile to use dynamic version detection Replaced static clang compiler configuration with dynamic detection using the `detect_api` functionality. This change ensures that the compiler and its version are automatically identified, improving flexibility and compatibility with different environments. The executable paths for C and C++ compilers are now dynamically set, enhancing build robustness. Contribute to NP-637 --- profiles/cura_clang.jinja | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/profiles/cura_clang.jinja b/profiles/cura_clang.jinja index fc7eaaa..60ace18 100644 --- a/profiles/cura_clang.jinja +++ b/profiles/cura_clang.jinja @@ -1,13 +1,10 @@ include(cura.jinja) - -[tool_requires] +{% set compiler, version, compiler_exe = detect_api.detect_clang_compiler(compiler_exe="clang") %} [settings] -compiler=clang -compiler.version=18 +compiler={{ compiler }} +compiler.version={{ version.major }} compiler.libcxx=libstdc++11 -[options] - [conf] -tools.build:compiler_executables={"c":"clang", "cpp":"clang++"} +tools.build:compiler_executables={"c":"{{ compiler_exe }}", "cpp":"{{ compiler_exe }}++"}