From a65d3d7f28c1784712219cf6f05e25dea76add1a Mon Sep 17 00:00:00 2001 From: ewaterlander <102143930+ewaterlander@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:16:52 +0200 Subject: [PATCH] Add user additional CMake arugments at the end. (#814) The additional CMake arguments added by the user in the launch configuration UI are added at the end of the CMake command, such that the user is able to override arguments set by the system. --- .../cdt/cmake/core/internal/CommandDescriptorBuilder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CommandDescriptorBuilder.java b/cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CommandDescriptorBuilder.java index a0957a66df4..715ce1b8743 100644 --- a/cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CommandDescriptorBuilder.java +++ b/cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CommandDescriptorBuilder.java @@ -78,8 +78,6 @@ CommandDescriptor makeCMakeCommandline(Path toolChainFile) throws CoreException } } CommandDescriptorBuilder.appendCMakeArguments(args, cmakeProperties.getExtraArguments()); - /* add settings for the operating system we are running under */ - CommandDescriptorBuilder.appendCMakeOsOverrideArgs(args, overridesSelector.getOsOverrides(cmakeProperties)); /* at last, add our requirements that override extra args specified by the user... */ { @@ -94,6 +92,10 @@ CommandDescriptor makeCMakeCommandline(Path toolChainFile) throws CoreException if (toolChainFile != null) { args.add("-DCMAKE_TOOLCHAIN_FILE=" + toolChainFile.toString()); //$NON-NLS-1$ } + /* Add settings for the operating system we are running under, + * and the user additional CMake arguments set in the Launch Configuration UI. + */ + CommandDescriptorBuilder.appendCMakeOsOverrideArgs(args, overridesSelector.getOsOverrides(cmakeProperties)); return new CommandDescriptor(args, env); }