Skip to content

presets: setting cmake.buildToolArgs in configuration leads to build failures #3754

Description

Brief Issue Summary

-- is missing in the cmake build command line.
Simple repro case attached (cmake-presets-build-tool-args.tar.gz)
Steps to reproduce:

  1. uncompress the archive
  2. open the folder with vscode
  3. configure & try to build with cmake => FAIL (see log below)
  4. remove either CMakePresets.json or .vscode/settings.json and try again => SUCCESS

CMake Tools Diagnostics

No response

Debug Log

[main] Building folder: cmake-presets-build-tool-args 
[main] Configuring project: cmake-presets-build-tool-args 
[driver] NOTE: You are configuring with preset Default Config, but there are some overrides being applied from your VS Code settings.
[proc] Executing command: /usr/bin/cmake -S/home/jallard/cmake-presets-build-tool-args -B/home/jallard/cmake-presets-build-tool-args/build/default -G Ninja
[cmake] -- Configuring done (0.0s)
[cmake] -- Generating done (0.0s)
[cmake] -- Build files have been written to: /home/jallard/cmake-presets-build-tool-args/build/default
[build] Starting build
[driver] NOTE: You are building with preset default, but there are some overrides being applied from your VS Code settings.
[proc] Executing command: /usr/bin/cmake --build /home/jallard/cmake-presets-build-tool-args/build/default -n
[build] Unknown argument -n
[build] Usage: cmake --build <dir>             [options] [-- [native-options]]
[build]        cmake --build --preset <preset> [options] [-- [native-options]]
[build] Options:
[build]   <dir>          = Project binary directory to be built.
[build]   --preset <preset>, --preset=<preset>
[build]                  = Specify a build preset.
[build]   --list-presets[=<type>]
[build]                  = List available build presets.
[build]   --parallel [<jobs>], -j [<jobs>]
[build]                  = Build in parallel using the given number of jobs. 
[build]                    If <jobs> is omitted the native build tool's 
[build]                    default number is used.
[build]                    The CMAKE_BUILD_PARALLEL_LEVEL environment variable
[build]                    specifies a default parallel level when this option
[build]                    is not given.
[build]   -t <tgt>..., --target <tgt>...
[build]                  = Build <tgt> instead of default targets.
[build]   --config <cfg> = For multi-configuration tools, choose <cfg>.
[build]   --clean-first  = Build target 'clean' first, then build.
[build]                    (To clean only, use --target 'clean'.)
[build]   --resolve-package-references={on|only|off}
[build]                  = Restore/resolve package references during build.
[build]   -v, --verbose  = Enable verbose output - if supported - including
[build]                    the build commands to be executed. 
[build]   --             = Pass remaining options to the native tool.
[proc] The command: /usr/bin/cmake --build /home/jallard/cmake-presets-build-tool-args/build/default -n exited with code: 1
[driver] Build completed: 00:00:00.012
[build] Build finished with exit code 1

Additional Information

I already have a simple fix, will submit a PR...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buga bug in the product

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions