Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration Command Includes Unremovable Options #1639

Open
ChrisThrasher opened this issue Jan 29, 2021 · 5 comments
Open

Configuration Command Includes Unremovable Options #1639

ChrisThrasher opened this issue Jan 29, 2021 · 5 comments
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: configure in progress actively being working on
Milestone

Comments

@ChrisThrasher
Copy link

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
@ChrisThrasher
Copy link
Author

If this much complexity is in fact necessary then I apologize for my misunderstanding.

@andreeis
Copy link
Contributor

andreeis commented Feb 3, 2021

Thank you for opening this report. We may look into implementing a possibility to remove the configure arguments sometime in future. We want to track the community reactions to this idea in order to correctly identify the priority in our backlog.

Regarding CMAKE_BUILD_TYPE, can you overwrite it to an empty string via settings cmake.configureSettings or cmake.configureArgs? Or by changing the cache variable entry (directly in CMakeCache.txt or with the command "CMake: Edit CMake Cache (UI)"?

@andreeis andreeis added this to the Backlog milestone Feb 4, 2021
@andreeis andreeis added the enhancement an enhancement to the product that is either not present or an improvement to an existing feature label Feb 4, 2021
@ChrisThrasher
Copy link
Author

ChrisThrasher commented 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.

@andreeis
Copy link
Contributor

andreeis commented Feb 5, 2021

Thank you for pointing to a repo that is directly impacted by the impossibility to have an empty CMAKE_BUILD_TYPE. We'll look into fixing this.

@andreeis andreeis modified the milestones: Backlog, 1.7.0 Feb 5, 2021
@andreeis andreeis self-assigned this Mar 2, 2021
@andreeis andreeis modified the milestones: 1.7.0, 1.8.0 Mar 26, 2021
@kleinesfilmroellchen
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: configure in progress actively being working on
Projects
Status: Pending Prioritization
Development

No branches or pull requests

4 participants