[gnome-builder] cmake: fix usage of toolchain cross-file



commit 0de192cc85fc442ef16dceb435dc38556cc9e6f3
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 23 10:08:57 2019 -0800

    cmake: fix usage of toolchain cross-file
    
    Fixes #778

 src/plugins/cmake/gbp-cmake-build-stage-cross-file.c | 16 +++++++++-------
 src/plugins/cmake/gbp-cmake-build-stage-cross-file.h |  5 ++---
 src/plugins/cmake/gbp-cmake-pipeline-addin.c         |  2 +-
 3 files changed, 12 insertions(+), 11 deletions(-)
---
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 e2fdd33aa..f3a0aebe6 100644
--- a/src/plugins/cmake/gbp-cmake-build-stage-cross-file.c
+++ b/src/plugins/cmake/gbp-cmake-build-stage-cross-file.c
@@ -198,19 +198,21 @@ gbp_cmake_build_stage_cross_file_init (GbpCMakeBuildStageCrossFile *self)
 }
 
 GbpCMakeBuildStageCrossFile *
-gbp_cmake_build_stage_cross_file_new (IdeContext    *context,
-                                      IdeToolchain  *toolchain)
+gbp_cmake_build_stage_cross_file_new (IdeToolchain *toolchain)
 {
-  GbpCMakeBuildStageCrossFile *build_stage = g_object_new (GBP_TYPE_CMAKE_BUILD_STAGE_CROSS_FILE,
-                                                           "context", context,
-                                                           NULL);
+  GbpCMakeBuildStageCrossFile *build_stage;
+
+  g_return_val_if_fail (IDE_IS_TOOLCHAIN (toolchain), NULL);
+
+  build_stage = g_object_new (GBP_TYPE_CMAKE_BUILD_STAGE_CROSS_FILE, NULL);
   build_stage->toolchain = g_object_ref (toolchain);
-  return build_stage;
+
+  return g_steal_pointer (&build_stage);
 }
 
 gchar *
 gbp_cmake_build_stage_cross_file_get_path (GbpCMakeBuildStageCrossFile *stage,
-                                           IdePipeline            *pipeline)
+                                           IdePipeline                 *pipeline)
 {
   g_return_val_if_fail (GBP_IS_CMAKE_BUILD_STAGE_CROSS_FILE (stage), NULL);
   g_return_val_if_fail (IDE_IS_PIPELINE (pipeline), NULL);
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 307dc34cc..a985e3869 100644
--- a/src/plugins/cmake/gbp-cmake-build-stage-cross-file.h
+++ b/src/plugins/cmake/gbp-cmake-build-stage-cross-file.h
@@ -30,9 +30,8 @@ G_BEGIN_DECLS
 
 G_DECLARE_FINAL_TYPE (GbpCMakeBuildStageCrossFile, gbp_cmake_build_stage_cross_file, GBP, 
CMAKE_BUILD_STAGE_CROSS_FILE, IdePipelineStage)
 
-GbpCMakeBuildStageCrossFile *gbp_cmake_build_stage_cross_file_new      (IdeContext                  *context,
-                                                                        IdeToolchain                
*toolchain);
+GbpCMakeBuildStageCrossFile *gbp_cmake_build_stage_cross_file_new      (IdeToolchain                
*toolchain);
 gchar                       *gbp_cmake_build_stage_cross_file_get_path (GbpCMakeBuildStageCrossFile *stage,
-                                                                        IdePipeline            *pipeline);
+                                                                        IdePipeline                 
*pipeline);
 
 G_END_DECLS
diff --git a/src/plugins/cmake/gbp-cmake-pipeline-addin.c b/src/plugins/cmake/gbp-cmake-pipeline-addin.c
index 447b9b007..88d45f925 100644
--- a/src/plugins/cmake/gbp-cmake-pipeline-addin.c
+++ b/src/plugins/cmake/gbp-cmake-pipeline-addin.c
@@ -156,7 +156,7 @@ gbp_cmake_pipeline_addin_load (IdePipelineAddin *addin,
   else if (g_strcmp0 (ide_toolchain_get_id (toolchain), "default") != 0)
     {
       GbpCMakeBuildStageCrossFile *cross_file_stage;
-      cross_file_stage = gbp_cmake_build_stage_cross_file_new (context, toolchain);
+      cross_file_stage = gbp_cmake_build_stage_cross_file_new (toolchain);
       crossbuild_file = gbp_cmake_build_stage_cross_file_get_path (cross_file_stage, pipeline);
 
       id = ide_pipeline_attach (pipeline, IDE_PIPELINE_PHASE_PREPARE, 0, IDE_PIPELINE_STAGE 
(cross_file_stage));


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