Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97313

How to configure the VS Code CMake Extension to use multiple Toolchain files

$
0
0

I am using VS Code and the CMake Extension. I have a CMakelists.txt file and two Toolchain files.

  1. ToolchainFile_Release.cmake
  2. ToolchainFile_Debug.cmake

Both files have different configurations in the compiler flags (different optimization levels).

When I put the both files in the configureArgs parameter, I don't know, if the extension can differentiate between both files and if the extension know which toolchain file in which case shall take:

"cmake.configureArgs": [
    "-DCMAKE_TOOLCHAIN_FILE=\"../ToolchainFile_Debug.cmake\"",
    "-DCMAKE_TOOLCHAIN_FILE=\"../ToolchainFile_Release.cmake\""
]

How can I tell the CMake extension to use in debug the ToolchainFile_Debug.cmake and in release, the ToolchainFile_Release.cmake?

In eclipse it is possible to choose between different configurations. So I think in VS Code it is also possible to choose between different configurations.


Viewing all articles
Browse latest Browse all 97313

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>