question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configuration Command Includes Unremovable Options

See original GitHub issue

Brief Issue Summary

It is not possible to not specify a CMAKE_BUILD_TYPE. More generally, CMake Tools appends many options to the cmake invocation that cannot be removed.

Expected:

Allow configuration commands as simple as cmake .. from the build/ directory.

Apparent Behavior:

Configuration commands include many more flags and typically look something like

/usr/local/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++ -H/Users/Thrasher/Projects/timecard -B/Users/Thrasher/Projects/timecard/build -G "Unix Makefiles"

without any way to remove these options and flags.

This becomes a problem on projects that require that users do not specify CMAKE_BUILD_TYPE.

Platform and Versions

  • Operating System: macOS 10.15.7
  • CMake Version: 3.17.3
  • VSCode Version: 1.52.1
  • CMake Tools Extension Version: v1.5.3
  • Compiler/Toolchain: Apple Clang version 12.0.0

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
kleinesfilmroellchencommented, Jun 19, 2021

I have the same issue with the same project, and other VSCode users in the SerenityOS developer community appear to struggle with it as well.

2reactions
ChrisThrashercommented, Feb 5, 2021

can you overwrite it to an empty string via settings cmake.configureSettings or cmake.configureArgs?

I tried adding -DCMAKE_BUILD_TYPE="" to configureArgs but it appeared before the autogenerated -DCMAKE_BUILD_TYPE:STRING=<some build type> so I think the latter takes precedent.

[proc] Executing command: /usr/local/bin/cmake --no-warn-unused-cli -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE="" -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/local/bin/gcc-10 -DCMAKE_CXX_COMPILER:FILEPATH=/usr/local/bin/g++-10 -H/Users/Thrasher/Projects/serenity -B/Users/Thrasher/Projects/serenity/Build -G Ninja

Or by changing the cache variable entry (directly in CMakeCache.txt or with the command “CMake: Edit CMake Cache (UI)”?

This didn’t appear to fix the problem either.

For context I’m building SerenityOS which uses very specific compiler flags which clash with the flags CMake adds when you specify a build type.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the CLI to implement configuration changes
How to use the CLI to view the current configuration files. Use show commands to view the configuration for individual features, such as...
Read more >
Cisco IOS Configuration Fundamentals Command Reference
(Optional) Displays the edited configuration that will replace the current configuration. Defaults. This command has no default settings. Command Modes. MST ...
Read more >
Overview of the Configure Command | Junos OS
Junos OS supports three forms of the configure command: configure , configure private , and configure exclusive . These forms control how users...
Read more >
How to Manage and Save Running Config on Cisco Devices
Note that Cisco IOS does not have a command that erases the contents of the running configuration file. To clear out the running...
Read more >
remove-option-from-option-group — AWS CLI 1.27.32 ...
Permanent options, such as the TDE option for Oracle Advanced Security ... For example, the NATIVE_NETWORK_ENCRYPTION option has a setting called SQLNET.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found