[gnome-builder: 65/139] cmake: port to libide-foundry



commit a0f1572811b1bdf93142f7632dcea3664baa610d
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 9 17:06:41 2019 -0800

    cmake: port to libide-foundry
    
    This ports the cmake plugin to use new abstractions provided by the
    libide-foundry static library.

 src/plugins/cmake/cmake-plugin.c                   | 24 ++++++++---
 src/plugins/cmake/cmake.gresource.xml              |  4 +-
 src/plugins/cmake/cmake.plugin                     | 13 +++---
 .../cmake/gbp-cmake-build-stage-cross-file.c       |  2 +-
 .../cmake/gbp-cmake-build-stage-cross-file.h       |  2 +-
 .../cmake/gbp-cmake-build-system-discovery.c       | 49 ++++++++++++++++++++++
 .../cmake/gbp-cmake-build-system-discovery.h       | 31 ++++++++++++++
 src/plugins/cmake/gbp-cmake-build-system.c         | 24 +++++------
 src/plugins/cmake/gbp-cmake-build-system.h         |  2 +-
 src/plugins/cmake/gbp-cmake-build-target.h         |  2 +-
 src/plugins/cmake/gbp-cmake-pipeline-addin.c       | 15 +++----
 src/plugins/cmake/gbp-cmake-pipeline-addin.h       |  2 +-
 src/plugins/cmake/gbp-cmake-toolchain-provider.c   |  8 ++--
 src/plugins/cmake/gbp-cmake-toolchain-provider.h   |  2 +-
 src/plugins/cmake/gbp-cmake-toolchain.c            |  2 +-
 src/plugins/cmake/gbp-cmake-toolchain.h            |  2 +-
 src/plugins/cmake/meson.build                      | 28 +++++--------
 17 files changed, 147 insertions(+), 65 deletions(-)
---
diff --git a/src/plugins/cmake/cmake-plugin.c b/src/plugins/cmake/cmake-plugin.c
index 94081dfc5..f59624847 100644
--- a/src/plugins/cmake/cmake-plugin.c
+++ b/src/plugins/cmake/cmake-plugin.c
@@ -18,17 +18,29 @@
  * SPDX-License-Identifier: GPL-3.0-or-later
  */
 
+#include "config.h"
+
 #include <libpeas/peas.h>
-#include <ide.h>
+#include <libide-foundry.h>
 
 #include "gbp-cmake-build-system.h"
+#include "gbp-cmake-build-system-discovery.h"
 #include "gbp-cmake-pipeline-addin.h"
 #include "gbp-cmake-toolchain-provider.h"
 
-void
-gbp_cmake_register_types (PeasObjectModule *module)
+_IDE_EXTERN void
+_gbp_cmake_register_types (PeasObjectModule *module)
 {
-  peas_object_module_register_extension_type (module, IDE_TYPE_BUILD_PIPELINE_ADDIN, 
GBP_TYPE_CMAKE_PIPELINE_ADDIN);
-  peas_object_module_register_extension_type (module, IDE_TYPE_BUILD_SYSTEM, GBP_TYPE_CMAKE_BUILD_SYSTEM);
-  peas_object_module_register_extension_type (module, IDE_TYPE_TOOLCHAIN_PROVIDER, 
GBP_TYPE_CMAKE_TOOLCHAIN_PROVIDER);
+  peas_object_module_register_extension_type (module,
+                                              IDE_TYPE_BUILD_PIPELINE_ADDIN,
+                                              GBP_TYPE_CMAKE_PIPELINE_ADDIN);
+  peas_object_module_register_extension_type (module,
+                                              IDE_TYPE_BUILD_SYSTEM,
+                                              GBP_TYPE_CMAKE_BUILD_SYSTEM);
+  peas_object_module_register_extension_type (module,
+                                              IDE_TYPE_BUILD_SYSTEM_DISCOVERY,
+                                              GBP_TYPE_CMAKE_BUILD_SYSTEM_DISCOVERY);
+  peas_object_module_register_extension_type (module,
+                                              IDE_TYPE_TOOLCHAIN_PROVIDER,
+                                              GBP_TYPE_CMAKE_TOOLCHAIN_PROVIDER);
 }
diff --git a/src/plugins/cmake/cmake.gresource.xml b/src/plugins/cmake/cmake.gresource.xml
index df2cf043d..df918ea9b 100644
--- a/src/plugins/cmake/cmake.gresource.xml
+++ b/src/plugins/cmake/cmake.gresource.xml
@@ -1,9 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
-  <gresource prefix="/org/gnome/builder/plugins">
+  <gresource prefix="/plugins/cmake">
     <file>cmake.plugin</file>
-  </gresource>
-  <gresource prefix="/org/gnome/builder/plugins/cmake">
     <file>CMakeLists.txt</file>
     <file>toolchain-info.ini.cmake</file>
   </gresource>
diff --git a/src/plugins/cmake/cmake.plugin b/src/plugins/cmake/cmake.plugin
index 2edfe3810..f7e1b41ec 100644
--- a/src/plugins/cmake/cmake.plugin
+++ b/src/plugins/cmake/cmake.plugin
@@ -1,10 +1,11 @@
 [Plugin]
-Module=cmake-plugin
-Name=CMake
-Description=Provides integration with the CMake build system
 Authors=Martin Blanchard <tchaik gmx com>
-Copyright=Copyright © 2017 Martin Blanchard
 Builtin=true
-X-Project-File-Filter-Pattern=CMakeLists.txt
+Copyright=Copyright © 2017 Martin Blanchard
+Description=Provides integration with the CMake build system
+Embedded=_gbp_cmake_register_types
+Hidden=true
+Module=cmake
+Name=CMake
 X-Project-File-Filter-Name=CMake Project (CMakeLists.txt)
-Embedded=gbp_cmake_register_types
+X-Project-File-Filter-Pattern=CMakeLists.txt
diff --git a/src/plugins/cmake/gbp-cmake-build-stage-cross-file.c 
b/src/plugins/cmake/gbp-cmake-build-stage-cross-file.c
index 537815d8f..e5b84a4ec 100644
--- a/src/plugins/cmake/gbp-cmake-build-stage-cross-file.c
+++ b/src/plugins/cmake/gbp-cmake-build-stage-cross-file.c
@@ -65,6 +65,7 @@ _gbp_cmake_file_set_quoted (gchar       **content,
 static void
 gbp_cmake_build_stage_cross_file_query (IdeBuildStage    *stage,
                                         IdeBuildPipeline *pipeline,
+                                        GPtrArray        *targets,
                                         GCancellable     *cancellable)
 {
   GbpCMakeBuildStageCrossFile *self = (GbpCMakeBuildStageCrossFile *)stage;
@@ -194,7 +195,6 @@ gbp_cmake_build_stage_cross_file_class_init (GbpCMakeBuildStageCrossFileClass *k
 static void
 gbp_cmake_build_stage_cross_file_init (GbpCMakeBuildStageCrossFile *self)
 {
-  
 }
 
 GbpCMakeBuildStageCrossFile *
diff --git a/src/plugins/cmake/gbp-cmake-build-stage-cross-file.h 
b/src/plugins/cmake/gbp-cmake-build-stage-cross-file.h
index 707aa015e..2256848e0 100644
--- a/src/plugins/cmake/gbp-cmake-build-stage-cross-file.h
+++ b/src/plugins/cmake/gbp-cmake-build-stage-cross-file.h
@@ -22,7 +22,7 @@
 
 #pragma once
 
-#include <ide.h>
+#include <libide-foundry.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/plugins/cmake/gbp-cmake-build-system-discovery.c 
b/src/plugins/cmake/gbp-cmake-build-system-discovery.c
new file mode 100644
index 000000000..d06cfa91a
--- /dev/null
+++ b/src/plugins/cmake/gbp-cmake-build-system-discovery.c
@@ -0,0 +1,49 @@
+/* gbp-cmake-build-system-discovery.c
+ *
+ * Copyright 2018-2019 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-cmake-build-system-discovery"
+
+#include "config.h"
+
+#include "gbp-cmake-build-system-discovery.h"
+
+struct _GbpCmakeBuildSystemDiscovery
+{
+  IdeSimpleBuildSystemDiscovery parent;
+};
+
+G_DEFINE_TYPE (GbpCmakeBuildSystemDiscovery,
+               gbp_cmake_build_system_discovery,
+               IDE_TYPE_SIMPLE_BUILD_SYSTEM_DISCOVERY)
+
+static void
+gbp_cmake_build_system_discovery_class_init (GbpCmakeBuildSystemDiscoveryClass *klass)
+{
+}
+
+static void
+gbp_cmake_build_system_discovery_init (GbpCmakeBuildSystemDiscovery *self)
+{
+  g_object_set (self,
+                "hint", "cmake",
+                "glob", "CMakeLists.txt",
+                "priority", 100,
+                NULL);
+}
diff --git a/src/plugins/cmake/gbp-cmake-build-system-discovery.h 
b/src/plugins/cmake/gbp-cmake-build-system-discovery.h
new file mode 100644
index 000000000..5bbbc4542
--- /dev/null
+++ b/src/plugins/cmake/gbp-cmake-build-system-discovery.h
@@ -0,0 +1,31 @@
+/* gbp-cmake-build-system-discovery.h
+ *
+ * Copyright 2018-2019 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <libide-foundry.h>
+
+G_BEGIN_DECLS
+
+#define GBP_TYPE_CMAKE_BUILD_SYSTEM_DISCOVERY (gbp_cmake_build_system_discovery_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpCmakeBuildSystemDiscovery, gbp_cmake_build_system_discovery, GBP, 
CMAKE_BUILD_SYSTEM_DISCOVERY, IdeSimpleBuildSystemDiscovery)
+
+G_END_DECLS
diff --git a/src/plugins/cmake/gbp-cmake-build-system.c b/src/plugins/cmake/gbp-cmake-build-system.c
index daf3a9eed..c2cb5bc66 100644
--- a/src/plugins/cmake/gbp-cmake-build-system.c
+++ b/src/plugins/cmake/gbp-cmake-build-system.c
@@ -132,10 +132,11 @@ gbp_cmake_build_system_ensure_config_async (GbpCMakeBuildSystem *self,
   ide_task_set_priority (task, G_PRIORITY_LOW);
 
   context = ide_object_get_context (IDE_OBJECT (self));
-  build_manager = ide_context_get_build_manager (context);
+  build_manager = ide_build_manager_from_context (context);
 
   ide_build_manager_execute_async (build_manager,
                                    IDE_BUILD_PHASE_CONFIGURE,
+                                   NULL,
                                    cancellable,
                                    gbp_cmake_build_system_ensure_config_cb,
                                    g_steal_pointer (&task));
@@ -207,7 +208,7 @@ gbp_cmake_build_system_load_commands_config_cb (GObject      *object,
     }
 
   context = ide_object_get_context (IDE_OBJECT (self));
-  build_manager = ide_context_get_build_manager (context);
+  build_manager = ide_build_manager_from_context (context);
   pipeline = ide_build_manager_get_pipeline (build_manager);
 
   if (pipeline == NULL)
@@ -284,7 +285,7 @@ gbp_cmake_build_system_load_commands_async (GbpCMakeBuildSystem *self,
    */
 
   context = ide_object_get_context (IDE_OBJECT (self));
-  build_manager = ide_context_get_build_manager (context);
+  build_manager = ide_build_manager_from_context (context);
   pipeline = ide_build_manager_get_pipeline (build_manager);
 
   if (pipeline != NULL)
@@ -463,9 +464,9 @@ gbp_cmake_build_system_get_build_flags_cb (GObject      *object,
 
   /* Get non-standard system includes */
   context = ide_object_get_context (IDE_OBJECT (self));
-  config_manager = ide_context_get_configuration_manager (context);
+  config_manager = ide_configuration_manager_from_context (context);
   config = ide_configuration_manager_get_current (config_manager);
-  if (NULL != (runtime = ide_configuration_get_runtime (config)))
+  if ((runtime = ide_configuration_get_runtime (config)))
     system_includes = ide_runtime_get_system_include_dirs (runtime);
 
   build_flags = ide_compile_commands_lookup (compile_commands,
@@ -482,27 +483,24 @@ gbp_cmake_build_system_get_build_flags_cb (GObject      *object,
 
 static void
 gbp_cmake_build_system_get_build_flags_async (IdeBuildSystem      *build_system,
-                                              IdeFile             *file,
+                                              GFile               *file,
                                               GCancellable        *cancellable,
                                               GAsyncReadyCallback  callback,
                                               gpointer             user_data)
 {
   GbpCMakeBuildSystem *self = (GbpCMakeBuildSystem *)build_system;
   g_autoptr(IdeTask) task = NULL;
-  GFile *gfile;
 
   IDE_ENTRY;
 
   g_assert (GBP_IS_CMAKE_BUILD_SYSTEM (self));
-  g_assert (IDE_IS_FILE (file));
+  g_assert (G_IS_FILE (file));
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
-  gfile = ide_file_get_file (file);
-
   task = ide_task_new (self, cancellable, callback, user_data);
   ide_task_set_priority (task, G_PRIORITY_LOW);
   ide_task_set_source_tag (task, gbp_cmake_build_system_get_build_flags_async);
-  ide_task_set_task_data (task, g_object_ref (gfile), g_object_unref);
+  ide_task_set_task_data (task, g_object_ref (file), g_object_unref);
 
   gbp_cmake_build_system_load_commands_async (self,
                                               cancellable,
@@ -576,7 +574,7 @@ gbp_cmake_build_system_init_worker (IdeTask      *task,
 
   name = g_file_get_basename (project_file);
 
-  if (dzl_str_equal0 (name, "CMakeLists.txt"))
+  if (ide_str_equal0 (name, "CMakeLists.txt"))
     {
       ide_task_return_pointer (task, g_object_ref (project_file), g_object_unref);
       IDE_EXIT;
@@ -623,7 +621,7 @@ gbp_cmake_build_system_init_async (GAsyncInitable      *initable,
   context = ide_object_get_context (IDE_OBJECT (self));
   g_assert (IDE_IS_CONTEXT (context));
 
-  build_manager = ide_context_get_build_manager (context);
+  build_manager = ide_build_manager_from_context (context);
   g_assert (IDE_IS_BUILD_MANAGER (build_manager));
 
   task = ide_task_new (self, cancellable, callback, user_data);
diff --git a/src/plugins/cmake/gbp-cmake-build-system.h b/src/plugins/cmake/gbp-cmake-build-system.h
index d0aa48706..16632c290 100644
--- a/src/plugins/cmake/gbp-cmake-build-system.h
+++ b/src/plugins/cmake/gbp-cmake-build-system.h
@@ -21,7 +21,7 @@
 
 #pragma once
 
-#include <ide.h>
+#include <libide-foundry.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/plugins/cmake/gbp-cmake-build-target.h b/src/plugins/cmake/gbp-cmake-build-target.h
index b5f7ae738..fb299dd3e 100644
--- a/src/plugins/cmake/gbp-cmake-build-target.h
+++ b/src/plugins/cmake/gbp-cmake-build-target.h
@@ -21,7 +21,7 @@
 
 #pragma once
 
-#include <ide.h>
+#include <libide-foundry.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/plugins/cmake/gbp-cmake-pipeline-addin.c b/src/plugins/cmake/gbp-cmake-pipeline-addin.c
index 7992dbbe2..a60fa47ef 100644
--- a/src/plugins/cmake/gbp-cmake-pipeline-addin.c
+++ b/src/plugins/cmake/gbp-cmake-pipeline-addin.c
@@ -53,6 +53,7 @@ gbp_cmake_pipeline_addin_init (GbpCMakePipelineAddin *self)
 static void
 gbp_cmake_pipeline_addin_stage_query_cb (IdeBuildStage    *stage,
                                          IdeBuildPipeline *pipeline,
+                                         GPtrArray        *targets,
                                          GCancellable     *cancellable)
 {
   g_assert (IDE_IS_BUILD_STAGE (stage));
@@ -79,7 +80,7 @@ gbp_cmake_pipeline_addin_load (IdeBuildPipelineAddin *addin,
   g_autofree gchar *prefix_option = NULL;
   g_autofree gchar *build_ninja = NULL;
   g_autofree gchar *crossbuild_file = NULL;
-  GFile *project_file;
+  g_autoptr(GFile) project_file = NULL;
   g_autofree gchar *project_file_name = NULL;
   g_autofree gchar *srcdir = NULL;
   IdeBuildSystem *build_system;
@@ -101,11 +102,11 @@ gbp_cmake_pipeline_addin_load (IdeBuildPipelineAddin *addin,
 
   context = ide_object_get_context (IDE_OBJECT (self));
 
-  build_system = ide_context_get_build_system (context);
+  build_system = ide_build_system_from_context (context);
   if (!GBP_IS_CMAKE_BUILD_SYSTEM (build_system))
     IDE_GOTO (failure);
 
-  project_file = ide_context_get_project_file (context);
+  g_object_get (build_system, "project-file", &project_file, NULL);
   project_file_name = g_file_get_basename (project_file);
 
   configuration = ide_build_pipeline_get_configuration (pipeline);
@@ -158,7 +159,7 @@ gbp_cmake_pipeline_addin_load (IdeBuildPipelineAddin *addin,
       cross_file_stage = gbp_cmake_build_stage_cross_file_new (context, toolchain);
       crossbuild_file = gbp_cmake_build_stage_cross_file_get_path (cross_file_stage, pipeline);
 
-      id = ide_build_pipeline_connect (pipeline, IDE_BUILD_PHASE_PREPARE, 0, IDE_BUILD_STAGE 
(cross_file_stage));
+      id = ide_build_pipeline_attach (pipeline, IDE_BUILD_PHASE_PREPARE, 0, IDE_BUILD_STAGE 
(cross_file_stage));
       ide_build_pipeline_addin_track (addin, id);
     }
 
@@ -199,7 +200,7 @@ gbp_cmake_pipeline_addin_load (IdeBuildPipelineAddin *addin,
   if (g_file_test (build_ninja, G_FILE_TEST_IS_REGULAR))
     ide_build_stage_set_completed (configure_stage, TRUE);
 
-  id = ide_build_pipeline_connect (pipeline, IDE_BUILD_PHASE_CONFIGURE, 0, configure_stage);
+  id = ide_build_pipeline_attach (pipeline, IDE_BUILD_PHASE_CONFIGURE, 0, configure_stage);
   ide_build_pipeline_addin_track (addin, id);
 
   /* Setup our build stage */
@@ -228,7 +229,7 @@ gbp_cmake_pipeline_addin_load (IdeBuildPipelineAddin *addin,
                     G_CALLBACK (gbp_cmake_pipeline_addin_stage_query_cb),
                     NULL);
 
-  id = ide_build_pipeline_connect (pipeline, IDE_BUILD_PHASE_BUILD, 0, build_stage);
+  id = ide_build_pipeline_attach (pipeline, IDE_BUILD_PHASE_BUILD, 0, build_stage);
   ide_build_pipeline_addin_track (addin, id);
 
   /* Setup our install stage */
@@ -244,7 +245,7 @@ gbp_cmake_pipeline_addin_load (IdeBuildPipelineAddin *addin,
                     G_CALLBACK (gbp_cmake_pipeline_addin_stage_query_cb),
                     NULL);
 
-  id = ide_build_pipeline_connect (pipeline, IDE_BUILD_PHASE_INSTALL, 0, install_stage);
+  id = ide_build_pipeline_attach (pipeline, IDE_BUILD_PHASE_INSTALL, 0, install_stage);
   ide_build_pipeline_addin_track (addin, id);
 
   IDE_EXIT;
diff --git a/src/plugins/cmake/gbp-cmake-pipeline-addin.h b/src/plugins/cmake/gbp-cmake-pipeline-addin.h
index d4ce019a1..0f82e5a3d 100644
--- a/src/plugins/cmake/gbp-cmake-pipeline-addin.h
+++ b/src/plugins/cmake/gbp-cmake-pipeline-addin.h
@@ -21,7 +21,7 @@
 
 #pragma once
 
-#include <ide.h>
+#include <libide-foundry.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/plugins/cmake/gbp-cmake-toolchain-provider.c 
b/src/plugins/cmake/gbp-cmake-toolchain-provider.c
index 6c85cad8b..e33ba8bda 100644
--- a/src/plugins/cmake/gbp-cmake-toolchain-provider.c
+++ b/src/plugins/cmake/gbp-cmake-toolchain-provider.c
@@ -140,9 +140,8 @@ gbp_cmake_toolchain_provider_load_async (IdeToolchainProvider     *provider,
 {
   GbpCMakeToolchainProvider *self = (GbpCMakeToolchainProvider *)provider;
   g_autoptr(IdeTask) task = NULL;
+  g_autoptr(GFile) workdir = NULL;
   IdeContext *context;
-  IdeVcs *vcs;
-  GFile *workdir;
 
   IDE_ENTRY;
 
@@ -151,8 +150,7 @@ gbp_cmake_toolchain_provider_load_async (IdeToolchainProvider     *provider,
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
   context = ide_object_get_context (IDE_OBJECT (self));
-  vcs = ide_context_get_vcs (context);
-  workdir = ide_vcs_get_working_directory (vcs);
+  workdir = ide_context_ref_workdir (context);
 
   task = ide_task_new (provider, cancellable, callback, user_data);
   ide_task_set_source_tag (task, gbp_cmake_toolchain_provider_load_async);
@@ -235,5 +233,5 @@ gbp_cmake_toolchain_provider_class_init (GbpCMakeToolchainProviderClass *klass)
 static void
 gbp_cmake_toolchain_provider_init (GbpCMakeToolchainProvider *self)
 {
-  
+
 }
diff --git a/src/plugins/cmake/gbp-cmake-toolchain-provider.h 
b/src/plugins/cmake/gbp-cmake-toolchain-provider.h
index a3c785921..cbf3f1d5f 100644
--- a/src/plugins/cmake/gbp-cmake-toolchain-provider.h
+++ b/src/plugins/cmake/gbp-cmake-toolchain-provider.h
@@ -22,7 +22,7 @@
 
 #pragma once
 
-#include <ide.h>
+#include <libide-foundry.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/plugins/cmake/gbp-cmake-toolchain.c b/src/plugins/cmake/gbp-cmake-toolchain.c
index 5b456fc1e..a21452ad6 100644
--- a/src/plugins/cmake/gbp-cmake-toolchain.c
+++ b/src/plugins/cmake/gbp-cmake-toolchain.c
@@ -66,7 +66,7 @@ gbp_cmake_toolchain_new (IdeContext   *context)
  *
  * Returns: (transfer none): the path to the CMake cross-compilation definitions file.
  *
- * Since: 3.32
+ * Since: 3.30
  */
 const gchar *
 gbp_cmake_toolchain_get_file_path (GbpCMakeToolchain  *self)
diff --git a/src/plugins/cmake/gbp-cmake-toolchain.h b/src/plugins/cmake/gbp-cmake-toolchain.h
index 038ce4c12..67f1d4795 100644
--- a/src/plugins/cmake/gbp-cmake-toolchain.h
+++ b/src/plugins/cmake/gbp-cmake-toolchain.h
@@ -22,7 +22,7 @@
 
 #pragma once
 
-#include <ide.h>
+#include <libide-foundry.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/plugins/cmake/meson.build b/src/plugins/cmake/meson.build
index b13e99851..37abefb9b 100644
--- a/src/plugins/cmake/meson.build
+++ b/src/plugins/cmake/meson.build
@@ -1,28 +1,22 @@
-if get_option('with_cmake')
+if get_option('plugin_cmake')
 
-cmake_resources = gnome.compile_resources(
-  'gbp-cmake-resources',
-  'cmake.gresource.xml',
-  c_name: 'gbp_cmake',
-)
-
-cmake_sources = [
+plugins_sources += files([
   'cmake-plugin.c',
   'gbp-cmake-build-stage-cross-file.c',
-  'gbp-cmake-build-stage-cross-file.h',
   'gbp-cmake-build-system.c',
-  'gbp-cmake-build-system.h',
+  'gbp-cmake-build-system-discovery.c',
   'gbp-cmake-build-target.c',
-  'gbp-cmake-build-target.h',
   'gbp-cmake-pipeline-addin.c',
-  'gbp-cmake-pipeline-addin.h',
   'gbp-cmake-toolchain.c',
-  'gbp-cmake-toolchain.h',
   'gbp-cmake-toolchain-provider.c',
-  'gbp-cmake-toolchain-provider.h',
-]
+])
+
+plugin_cmake_resources = gnome.compile_resources(
+  'gbp-cmake-resources',
+  'cmake.gresource.xml',
+  c_name: 'gbp_cmake',
+)
 
-gnome_builder_plugins_sources += files(cmake_sources)
-gnome_builder_plugins_sources += cmake_resources[0]
+plugins_sources += plugin_cmake_resources[0]
 
 endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]