]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
devtool: ide: define compilerPath for meson projects
authorEnguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Thu, 22 Feb 2024 10:29:55 +0000 (11:29 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 23 Feb 2024 14:29:00 +0000 (14:29 +0000)
The compile_commands.json file output by meson uses the compiler as if
present in the $PATH. However, when using an IDE, the $PATH used by
bitbake is not there.

The vscode-cpptools now allows to define the compilerPath in addition
to replace the one from compile_commands.json.

Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/ide_plugins/ide_code.py
scripts/lib/devtool/ide_sdk.py

index f44665ed8729bda25e7c320506015c047d854664..d5e3a4f42157c25ae8c50bd80d934d1f7a14cd26 100644 (file)
@@ -194,6 +194,7 @@ class IdeVSCode(IdeBase):
             properties_dict["configurationProvider"] = "ms-vscode.cmake-tools"
         elif modified_recipe.build_tool is BuildTool.MESON:
             properties_dict["configurationProvider"] = "mesonbuild.mesonbuild"
+            properties_dict["compilerPath"] = os.path.join(modified_recipe.staging_bindir_toolchain, modified_recipe.cxx.split()[0])
         else:  # no C/C++ build
             return
 
index 146797448076cde711dfca8d39bdf31ec4cb5d18..b52b52ae7383417e7b5a5bfa93578166e55369a8 100755 (executable)
@@ -345,6 +345,7 @@ class RecipeModified:
         self.base_libdir = recipe_d.getVar('base_libdir')
         self.bblayers = recipe_d.getVar('BBLAYERS').split()
         self.bpn = recipe_d.getVar('BPN')
+        self.cxx = recipe_d.getVar('CXX')
         self.d = recipe_d.getVar('D')
         self.fakerootcmd = recipe_d.getVar('FAKEROOTCMD')
         self.fakerootenv = recipe_d.getVar('FAKEROOTENV')
@@ -360,6 +361,8 @@ class RecipeModified:
             recipe_d.getVar('RECIPE_SYSROOT'))
         self.recipe_sysroot_native = os.path.realpath(
             recipe_d.getVar('RECIPE_SYSROOT_NATIVE'))
+        self.staging_bindir_toolchain = os.path.realpath(
+            recipe_d.getVar('STAGING_BINDIR_TOOLCHAIN'))
         self.staging_incdir = os.path.realpath(
             recipe_d.getVar('STAGING_INCDIR'))
         self.strip_cmd = recipe_d.getVar('STRIP')