Open LikzSoftware opened 4 years ago
As a workaround, between step 2 and 3, you need to delete the build folder and reload the project. Not only delete the build folder (which equals to a 'delete cache and reconfigure'). Not only reload project without deleting the cache. Delete cache and reload project.
We fixed this problem (the need to delete the cache before a reload) for 'cmake.generator', but we weren't aware that the same happens for 'cmake.platform' and 'cmake.toolset'.
Then, we plan to fix for all 3 settings the need to reload.
What do you mean by "reload the project"?
If there is an issue with settings changes being reflected, then you can run the Developer: Reload Window
command in VS Code.
I just hit this,
Repro:
Bug: They aren't used when Delect Cache and Reconfigure are used until CMakeCache.txt is deleted from the build folder and then Reload Window is done.
Brief Issue Summary
I am trying to configure a project to be built with Visual Studio 2019 using a non-default toolchain (MSVC 2015 amd64), but cannot achieve the required configuration command via VSCode interface and CMake Tools configuration.
As far as I understood, it should work by selecting a kit and/or or by configuring generator / platform / toolset in the settings, but neither option gives the desired result.
Expected
When launching cmake manually as the following:
D:\DevTools\CMake\bin\cmake.EXE --no-warn-unused-cli -DSTATIC:STRING=ON -DBUILD_UNIT_TESTS:STRING=ON -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -Hd:/Source -Bd:/Source/build -G "Visual Studio 16 2019" -A x64 -T v140
I get:
Apparent Behavior:
[proc] Executing command: D:\DevTools\CMake\bin\cmake.EXE --no-warn-unused-cli -DSTATIC:STRING=ON -DBUILD_UNIT_TESTS:STRING=ON -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -Hd:/Source -Bd:/Source/build -G "Visual Studio 16 2019"
-A and -T options are missing, so the default toolchain for Visual Studio 2019 is used:
Other tested options
I get the same result if platform and toolset are omitted, and/or if cmake.ignoreKitEnv is selected.
I could override the configuration by passing
-A x64 -T v140
via cmake.configureArgs, but when I close and reopen VSCode they appear twice on the command line, which results in a cmake error:Platform and Versions