vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

Active build configuration warning

Open andreeis opened this issue 3 years ago • 11 comments

With current CMT code base, any project gets a warning from CppTools about. This is with presets on, but even if the currently selected configure preset does define CMAKE_BUILD_TYPE.

The build configurations generated do not contain the active build configuration. Using 'Debug' for CMAKE_BUILD_TYPE instead of 'null' to ensure that IntelliSense configurations can be found.

andreeis avatar Jan 31 '22 23:01 andreeis

@andreeis can you share the repro for this? And also run CMake: Log Diagnostics and share it here.

bobbrow avatar Feb 01 '22 17:02 bobbrow

Here you go. I am not noticing any hint. Also, on linux it doesn't happen and the below is on windows.

Expand C/C++ Log Diagnostics

-------- Diagnostics - 2/2/2022, 1:25:50 AM Version: 1.7.1 Current Configuration: { "name": "Win32", "includePath": [ "${workspaceFolder}/" ], "defines": [ "_DEBUG", "UNICODE", "_UNICODE" ], "windowsSdkVersion": "10.0.18362.0", "compilerPath": "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe", "cStandard": "c17", "cppStandard": "c++17", "intelliSenseMode": "windows-msvc-x64", "compilerArgs": [], "intelliSenseModeIsExplicit": false, "cStandardIsExplicit": false, "cppStandardIsExplicit": false, "mergeConfigurations": false, "compilerPathIsExplicit": false, "configurationProvider": "ms-vscode.cmake-tools", "browse": { "path": [ "${workspaceFolder}/" ], "limitSymbolsToIncludedHeaders": true } } Custom browse configuration: { "browsePath": [ "c:/work/projects/cmaketools/test1.10/quickstart1/out/build/cfgvs2019x64/cmakefiles", "c:/work/projects/cmaketools/test1.10/quickstart1/out/build/cfgvs2019x64/cmakefiles/9a5977fd6c1ef9d5456a0b2a0cdf454e", "c:/work/projects/cmaketools/test1.10/quickstart1" ], "compilerPath": "c:/program files (x86)/microsoft visual studio/2019/buildtools/vc/tools/msvc/14.28.29910/bin/hostx64/x64/cl.exe", "compilerArgs": [] } Custom configurations: [ C:\Work\Projects\CMakeTools\Test1.10\QuickStart1\main.cpp ] { "defines": [ "WIN32", "_WINDOWS" ], "includePath": [], "compilerPath": "c:/program files (x86)/microsoft visual studio/2019/buildtools/vc/tools/msvc/14.28.29910/bin/hostx64/x64/cl.exe", "compilerArgs": [ "/DWIN32", "/D_WINDOWS", "/W3", "/GR", "/EHsc", "/MDd", "/Zi", "/Ob0", "/Od", "/RTC1" ] } Translation Unit Mappings: [ C:\Work\Projects\CMakeTools\Test1.10\QuickStart1\main.cpp ]: C:\WORK\PROJECTS\CMAKETOOLS\TEST1.10\QUICKSTART1\MAIN.CPP Translation Unit Configurations: [ C:\Work\Projects\CMakeTools\Test1.10\QuickStart1\main.cpp ]: Process ID: 35856 Memory Usage: 17 MB Compiler Path: c:/program files (x86)/microsoft visual studio/2019/buildtools/vc/tools/msvc/14.28.29910/bin/hostx64/x64/cl.exe Includes: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\BUILDTOOLS\VC\TOOLS\MSVC\14.28.29910\INCLUDE C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UM C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\SHARED C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\WINRT C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\CPPWINRT Defines: WIN32 _WINDOWS WIN32 _WINDOWS Standard Version: ms_c++14 IntelliSense Mode: windows-msvc-x64 Other Flags: --rtti Total Memory Usage: 17 MB

------- Workspace parsing diagnostics ------- Number of files discovered (not excluded): 5045 Number of files parsed: 4

Expand CMake Tools Output Channel

[main] Safe constructing new CMakeTools instance [variant] Constructing VariantManager [main] Constructing new CMakeTools instance [main] Starting CMakeTools second-phase init [variant] Loaded new set of variants [main] CMakeTools instance initialization complete. [kit] Reading kits file C:\Users\andris\AppData\Local\CMakeTools\cmake-tools-kits.json [kit] Successfully loaded 36 kits from C:\Users\andris\AppData\Local\CMakeTools\cmake-tools-kits.json [kit] Not reading non-existent kits file: c:\Work\Projects\CMakeTools\Test1.10\QuickStart1.vscode\cmake-kits.json [presetController] Reading presets file c:\Work\Projects\CMakeTools\Test1.10\QuickStart1\CMakePresets.json [presetController] Successfully validated presets in c:\Work\Projects\CMakeTools\Test1.10\QuickStart1\CMakePresets.json [main] Resolving the selected configure preset [main] Loading new configure preset into CMake driver [main] Resolving the selected build preset [main] Loading new build preset into CMake driver [main] Resolving the selected test preset [main] Loading new test preset into CMake driver [extension] Configuring workspace on open file:///c%3A/Work/Projects/CMakeTools/Test1.10/QuickStart1 [main] Starting new CMake driver [main] Starting CMake driver [cmakefileapi-driver] Creating instance of CMakeFileApiDriver [driver] Initializating base driver using preset [driver] CMakeDriver configure preset set to CfgVS2019X64 [driver] CMakeDriver build preset set to BuildFromCfgVS2019X64 [driver] CMakeDriver test preset set to TestFromCfgVS2019X64 [cache] Reading CMake cache file c:/Work/Projects/CMakeTools/Test1.10/QuickStart1/out/build/CfgVS2019X64/CMakeCache.txt [cache] Parsing CMake cache string [cache] Reading CMake cache file c:/Work/Projects/CMakeTools/Test1.10/QuickStart1/out/build/CfgVS2019X64/CMakeCache.txt [cache] Parsing CMake cache string [cmakefileapi-parser] Read reply folder: c:\Work\Projects\CMakeTools\Test1.10\QuickStart1\out\build\CfgVS2019X64.cmake\api\v1\reply [cmakefileapi-parser] Found index files: ["cache-v2-3907fec7dec0371c28c2.json","codemodel-v2-239ae46a1fae5fa2653f.json","directory-.-Debug-d0094a50bb2071803777.json","directory-.-MinSizeRel-d0094a50bb2071803777.json","directory-.-Release-d0094a50bb2071803777.json","directory-.-RelWithDebInfo-d0094a50bb2071803777.json","index-2022-02-02T07-16-46-0205.json","target-ALL_BUILD-Debug-a13120f62a16846c36d2.json","target-ALL_BUILD-MinSizeRel-a13120f62a16846c36d2.json","target-ALL_BUILD-Release-a13120f62a16846c36d2.json","target-ALL_BUILD-RelWithDebInfo-a13120f62a16846c36d2.json","target-Continuous-Debug-63c8ede2cf40f8a22f08.json","target-Continuous-MinSizeRel-63c8ede2cf40f8a22f08.json","target-Continuous-Release-63c8ede2cf40f8a22f08.json","target-Continuous-RelWithDebInfo-63c8ede2cf40f8a22f08.json","target-Experimental-Debug-7683d1076167fda91ee5.json","target-Experimental-MinSizeRel-7683d1076167fda91ee5.json","target-Experimental-Release-7683d1076167fda91ee5.json","target-Experimental-RelWithDebInfo-7683d1076167fda91ee5.json","target-Nightly-Debug-9971f51fce3e8b1867de.json","target-Nightly-MinSizeRel-9971f51fce3e8b1867de.json","target-Nightly-Release-9971f51fce3e8b1867de.json","target-Nightly-RelWithDebInfo-9971f51fce3e8b1867de.json","target-NightlyMemoryCheck-Debug-c922b253a7ec7e3a19ab.json","target-NightlyMemoryCheck-MinSizeRel-c922b253a7ec7e3a19ab.json","target-NightlyMemoryCheck-Release-c922b253a7ec7e3a19ab.json","target-NightlyMemoryCheck-RelWithDebInfo-c922b253a7ec7e3a19ab.json","target-QuickTest-Debug-02aa8e8e7210ce231d05.json","target-QuickTest-MinSizeRel-f12a38e2a8c7c1d0cb02.json","target-QuickTest-Release-83298b692081ff0fcf27.json","target-QuickTest-RelWithDebInfo-fe878c0200b6181c4746.json","target-ZERO_CHECK-Debug-36800e54d5ddac5bf6c1.json","target-ZERO_CHECK-MinSizeRel-36800e54d5ddac5bf6c1.json","target-ZERO_CHECK-Release-36800e54d5ddac5bf6c1.json","target-ZERO_CHECK-RelWithDebInfo-36800e54d5ddac5bf6c1.json","toolchains-v1-eda23bf84c60b4bc0df1.json"] [driver] Setting new variant Debug [main] Configuring folder: QuickStart1 [main] Saving open files before configure/build [driver] Start configure [driver] Running pre-configure checks and steps [cmakefileapi-driver] Configuring using preset [cmakefileapi-driver] Invoking CMake C:\Program Files\CMake\bin\cmake.EXE with arguments ["-DCMAKE_BUILD_TYPE=Debug","-DCMAKE_INSTALL_PREFIX=c:/Work/Projects/CMakeTools/Test1.10/QuickStart1/out/install/CfgVS2019X64","-Sc:/Work/Projects/CMakeTools/Test1.10/QuickStart1","-Bc:/Work/Projects/CMakeTools/Test1.10/QuickStart1/out/build/CfgVS2019X64","-G","Visual Studio 16 2019","-T","host=x64","-A","x64"] [proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=c:/Work/Projects/CMakeTools/Test1.10/QuickStart1/out/install/CfgVS2019X64 -Sc:/Work/Projects/CMakeTools/Test1.10/QuickStart1 -Bc:/Work/Projects/CMakeTools/Test1.10/QuickStart1/out/build/CfgVS2019X64 -G "Visual Studio 16 2019" -T host=x64 -A x64 [cache] Reading CMake cache file c:/Work/Projects/CMakeTools/Test1.10/QuickStart1/out/build/CfgVS2019X64/CMakeCache.txt [cache] Parsing CMake cache string [cmake] -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.22000. [cpptools] The build configurations generated do not contain the active build configuration. Using "Debug" for CMAKE_BUILD_TYPE instead of "null" to ensure that IntelliSense configurations can be found [cmake] -- Configuring done [cmake] -- Generating done [cmake] -- Build files have been written to: C:/Work/Projects/CMakeTools/Test1.10/QuickStart1/out/build/CfgVS2019X64 [cmakefileapi-parser] Read reply folder: c:\Work\Projects\CMakeTools\Test1.10\QuickStart1\out\build\CfgVS2019X64.cmake\api\v1\reply [cmakefileapi-parser] Found index files: ["cache-v2-3907fec7dec0371c28c2.json","codemodel-v2-239ae46a1fae5fa2653f.json","directory-.-Debug-d0094a50bb2071803777.json","directory-.-MinSizeRel-d0094a50bb2071803777.json","directory-.-Release-d0094a50bb2071803777.json","directory-.-RelWithDebInfo-d0094a50bb2071803777.json","index-2022-02-02T09-24-13-0810.json","target-ALL_BUILD-Debug-a13120f62a16846c36d2.json","target-ALL_BUILD-MinSizeRel-a13120f62a16846c36d2.json","target-ALL_BUILD-Release-a13120f62a16846c36d2.json","target-ALL_BUILD-RelWithDebInfo-a13120f62a16846c36d2.json","target-Continuous-Debug-63c8ede2cf40f8a22f08.json","target-Continuous-MinSizeRel-63c8ede2cf40f8a22f08.json","target-Continuous-Release-63c8ede2cf40f8a22f08.json","target-Continuous-RelWithDebInfo-63c8ede2cf40f8a22f08.json","target-Experimental-Debug-7683d1076167fda91ee5.json","target-Experimental-MinSizeRel-7683d1076167fda91ee5.json","target-Experimental-Release-7683d1076167fda91ee5.json","target-Experimental-RelWithDebInfo-7683d1076167fda91ee5.json","target-Nightly-Debug-9971f51fce3e8b1867de.json","target-Nightly-MinSizeRel-9971f51fce3e8b1867de.json","target-Nightly-Release-9971f51fce3e8b1867de.json","target-Nightly-RelWithDebInfo-9971f51fce3e8b1867de.json","target-NightlyMemoryCheck-Debug-c922b253a7ec7e3a19ab.json","target-NightlyMemoryCheck-MinSizeRel-c922b253a7ec7e3a19ab.json","target-NightlyMemoryCheck-Release-c922b253a7ec7e3a19ab.json","target-NightlyMemoryCheck-RelWithDebInfo-c922b253a7ec7e3a19ab.json","target-QuickTest-Debug-02aa8e8e7210ce231d05.json","target-QuickTest-MinSizeRel-f12a38e2a8c7c1d0cb02.json","target-QuickTest-Release-83298b692081ff0fcf27.json","target-QuickTest-RelWithDebInfo-fe878c0200b6181c4746.json","target-ZERO_CHECK-Debug-36800e54d5ddac5bf6c1.json","target-ZERO_CHECK-MinSizeRel-36800e54d5ddac5bf6c1.json","target-ZERO_CHECK-Release-36800e54d5ddac5bf6c1.json","target-ZERO_CHECK-RelWithDebInfo-36800e54d5ddac5bf6c1.json","toolchains-v1-eda23bf84c60b4bc0df1.json"] [cache] Reading CMake cache file c:/Work/Projects/CMakeTools/Test1.10/QuickStart1/out/build/CfgVS2019X64/CMakeCache.txt [cache] Parsing CMake cache string [cache] Reading CMake cache file c:/Work/Projects/CMakeTools/Test1.10/QuickStart1/out/build/CfgVS2019X64/CMakeCache.txt [cache] Parsing CMake cache string [cpptools] The build configurations generated do not contain the active build configuration. Using "Debug" for CMAKE_BUILD_TYPE instead of "null" to ensure that IntelliSense configurations can be found [cpptools] The build configurations generated do not contain the active build configuration. Using "Debug" for CMAKE_BUILD_TYPE instead of "null" to ensure that IntelliSense configurations can be found

Expand CMakePresets.json

{ "version": 2, "configurePresets": [ { "name": "CfgVS2019X64", "displayName": "CfgVS2019X64", "description": "CfgVS2019X64", "generator": "Visual Studio 16 2019", "toolset": "host=x64", "architecture": "x64", "binaryDir": "${sourceDir}/out/build/${presetName}", "environment": { "MyEnv_Variable_CfgVS2019X64": "MyEnv_Value_CfgVS2019X64" }, "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}" } } ], "buildPresets": [ { "name": "BuildFromCfgVS2019X64", "description": "BuildFromCfgVS2019X64", "displayName": "BuildFromCfgVS2019X64", "environment": { "MyEnv_Variable_BuildFromCfgVS2019X64": "MyEnv_Value_BuildFromCfgVS2019X64" }, "inheritConfigureEnvironment": true, "configurePreset": "CfgVS2019X64" } ], "testPresets": [ { "name": "TestFromCfgVS2019X64", "description": "TestFromCfgVS2019X64", "displayName": "TestFromCfgVS2019X64", "environment": { "MyEnv_Variable_TestFromCfgVS2019X64": "MyEnv_Value_TestFromCfgVS2019X64" }, "inheritConfigureEnvironment": false, "configurePreset": "CfgVS2019X64" } ] }

andreeis avatar Feb 02 '22 09:02 andreeis

Can you also share the CMake: Log Diagnostics? C/C++ has a command with a similar name, I'm looking for the CMake one.

bobbrow avatar Feb 02 '22 17:02 bobbrow

Of course, I forgot about that one.

Expand CMake Log Diagnostics

{ "os": "win32", "vscodeVersion": "1.63.2", "cmtVersion": "1.10.0", "configurations": [ { "folder": "c:\Work\Projects\CMakeTools\Test1.10\QuickStart1", "cmakeVersion": "3.21.3", "configured": true, "generator": "Visual Studio 16 2019", "usesPresets": true, "compilers": {} } ], "cpptoolsIntegration": { "isReady": true, "hasCodeModel": true, "activeBuildType": "", "buildTypesSeen": [ "Debug", "Release", "MinSizeRel", "RelWithDebInfo" ], "requests": [], "responses": [], "partialMatches": [], "targetCount": 7, "executablesCount": 1, "librariesCount": 0, "targets": [ { "name": "ALL_BUILD", "type": "UTILITY" }, { "name": "Continuous", "type": "UTILITY" }, { "name": "Experimental", "type": "UTILITY" }, { "name": "Nightly", "type": "UTILITY" }, { "name": "NightlyMemoryCheck", "type": "UTILITY" }, { "name": "QuickTest", "type": "EXECUTABLE" }, { "name": "ZERO_CHECK", "type": "UTILITY" } ] }, "settings": [ { "communicationMode": "automatic", "useCMakePresets": "always", "configureOnOpen": true } ] }

andreeis avatar Feb 02 '22 21:02 andreeis

mac also has this bug too

AndrewDerain avatar Feb 22 '22 15:02 AndrewDerain

I am running into the same or a very similar error. Using Ubuntu with gcc, the CMake project uses a toolchain generated by Conan. I also am using CMake presets.

I install two configurations (Debug and Release) with Conan, the CMakePresets.json generated by Conan has two configurations:

    "configurePresets": [
        {
            "name": "Debug",
            "displayName": "Debug Config",
            "description": "Debug configure using 'Unix Makefiles' generator",
            "generator": "Unix Makefiles",
            "cacheVariables": {
                "CMAKE_POLICY_DEFAULT_CMP0091": "NEW",
                "CMAKE_BUILD_TYPE": "Debug"
            },
            "toolchainFile": "/home/chris/conantest/build/generators/conan_toolchain.cmake",
            "binaryDir": "/home/chris/conantest/cmake-build-debug"
        },
        {
            "name": "Release",
            "displayName": "Release Config",
            "description": "Release configure using 'Unix Makefiles' generator",
            "generator": "Unix Makefiles",
            "cacheVariables": {
                "CMAKE_POLICY_DEFAULT_CMP0091": "NEW",
                "CMAKE_BUILD_TYPE": "Release"
            },
            "toolchainFile": "/home/chris/conantest/build/generators/conan_toolchain.cmake",
            "binaryDir": "/home/chris/conantest/cmake-build-release"
        }
    ],
    "buildPresets": [
        {
            "name": "Debug",
            "configurePreset": "Debug"
        },
        {
            "name": "Release",
            "configurePreset": "Release"
        }
    ],

I've noticed that the cpptools warning always occurs when switching to a configuration that has not been built last. E.g. I configure "Debug", build "Debug", switch to "Release", then it would show

[cpptools] The build configurations generated do not contain the active build configuration. Using "Debug" for CMAKE_BUILD_TYPE instead of "Release" to ensure that IntelliSense configurations can be found

If I then build in Release mode and switch the config back to "Debug", it shows

[cpptools] The build configurations generated do not contain the active build configuration. Using "Release" for CMAKE_BUILD_TYPE instead of "Debug" to ensure that IntelliSense configurations can be found

Output of CMake: Log Diagnostics:

{
  "os": "linux",
  "vscodeVersion": "1.67.1",
  "cmtVersion": "1.10.0",
  "configurations": [
    {
      "folder": "/home/chris/conantest",
      "cmakeVersion": "3.23.1",
      "configured": true,
      "generator": "Unix Makefiles",
      "usesPresets": true,
      "compilers": {
        "CXX": "/usr/bin/c++"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Release"
    ],
    "requests": [
      "file:///home/chris/conantest/soxrtest.cpp"
    ],
    "responses": [
      {
        "uri": "file:///home/chris/conantest/soxrtest.cpp",
        "configuration": {
          "defines": [
            "_GLIBCXX_USE_CXX11_ABI=0",
            "NDEBUG"
          ],
          "includePath": [
            "/home/chris/.conan/data/soxr/0.1.3/_/_/package/fcf0f374adec7fe3c03d5a485bea5cbf91c66ab4/include"
          ],
          "compilerPath": "/usr/bin/c++",
          "compilerArgs": [
            "-m64",
            "-O3",
            "-DNDEBUG"
          ]
        }
      }
    ],
    "partialMatches": [],
    "targetCount": 1,
    "executablesCount": 1,
    "librariesCount": 0,
    "targets": [
      {
        "name": "soxrtest",
        "type": "EXECUTABLE"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

I think the problem lies in

    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Release"
    ],

The cpptools extension only seems to see the last-built build type but the active build type can be different.

chausner avatar May 14 '22 19:05 chausner

I see this behavior on Windows with MSVC / Ninja generator.

[cpptools] The build configurations generated do not contain the active build configuration. Using "Debug" for CMAKE_BUILD_TYPE instead of "null" to ensure that IntelliSense configurations can be found
Output of CMake: Log Diagnostics:

{
  "os": "win32",
  "vscodeVersion": "1.69.2",
  "cmtVersion": "1.11.26",
  "configurations": [
    {
      "folder": "c:\\Dev\\Projects\\Work\\XXXXXXXXX\\YYYYYYYYY-client",
      "cmakeVersion": "3.23.2",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": true,
      "compilers": {
        "C": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx86/x64/cl.exe",
        "CXX": "cl.exe"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [
      "file:///c%3A/Dev/Projects/Work/XXXXXXXXX/YYYYYYYYY-client/src/Abc/TaAbcBrowserItem.cpp"
    ],
    "responses": [
      {
        "uri": "file:///c%3A/Dev/Projects/Work/XXXXXXXXX/YYYYYYYYY-client/src/Abc/TaAbcBrowserItem.cpp",
        "configuration": {
          "includePath": [
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/out/build/windows-debug/src",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/src",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/out/build/windows-debug/src/XXXXXXXXX_autogen/include",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/src/render",
            "c:/program files (x86)/intel/oneapi/vtune/2022.2.0/sdk/include",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/third-party/Abc-cmake/Abc_binary_95.7.18+g0d6005e+chromium-95.0.4638.69_windows64",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/third-party/Abc-cmake/include",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/gfxd3d11_test/source/engine",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/gfxd3d11_test/source/gui",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/gfxd3d11_test/source/math",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/gfxd3d11_test/source/test",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/gfxd3d11_test/source/util",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/gfxd3d11_test/source",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/external/source/freetype/include",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/external/source/freetype/include/freetype",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libavccore/include/avc/coreplatform.h",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libavccore/include/avc/_platform/_environment.h",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libavccore/include/avc/_platform/_include.h",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libavccore/include/avc/_platform/_types.h",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libavccore/include/avc/_platform/_environment/arch/x86.h",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libavccore/include/avc/_platform/_environment/arch/x86_64.h",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libavccore/include/avc/_platform/_environment/compiler/clang.h",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libavccore/include/avc/_platform/_environment/compiler/gcc.h",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libavccore/include/avc/_platform/_environment/compiler/msvc.h",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libavccore/include/avc/_platform/_environment/os/linux.h",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libavccore/include/avc/_platform/_environment/os/windesktop.h",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libavccore/include",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libgfxd3d11/include",
            "c:/dev/projects/work/XXXXXXXXX/YYYYYYYYY-client/submodules/dcn/libgfx/include",
            "c:/dev/projects/qt/6.2.0/msvc2019_64/include/qtcore",
            "c:/dev/projects/qt/6.2.0/msvc2019_64/include",
            "c:/dev/projects/qt/6.2.0/msvc2019_64/mkspecs/win32-msvc",
            "c:/dev/projects/qt/6.2.0/msvc2019_64/include/qtquick",
            "c:/dev/projects/qt/6.2.0/msvc2019_64/include/qtgui",
            "c:/dev/projects/qt/6.2.0/msvc2019_64/include/qtqml",
            "c:/dev/projects/qt/6.2.0/msvc2019_64/include/qtnetwork",
            "c:/dev/projects/qt/6.2.0/msvc2019_64/include/qtqmlmodels",
            "c:/dev/projects/qt/6.2.0/msvc2019_64/include/qtopengl",
            "c:/dev/projects/qt/6.2.0/msvc2019_64/include/qtquickcontrols2"
          ],
          "defines": [
            "Abc_MAJOR_VERSION=95",
            "Abc_MULTI_THREADED_MSG_LOOP=true",
            "Abc_OSR_ENABLED=true",
            "Abc_RESOURCE_DIR=\"C:/Dev/Projects/Work/XXXXXXXXX/YYYYYYYYY-client/web-root\"",
            "Abc_URI_ROOT=\"http://nc.XXXXXXXXX.io\"",
            "NOMINMAX",
            "QT_CORE_LIB",
            "QT_GUI_LIB",
            "QT_NETWORK_LIB",
            "QT_OPENGL_LIB",
            "QT_QMLMODELS_LIB",
            "QT_QML_DEBUG",
            "QT_QML_LIB",
            "QT_QUICKCONTROLS2_LIB",
            "QT_QUICK_LIB",
            "TA_Abc_DOM_LAYOUT_SYNC=false",
            "TA_Abc_JSBIND_LAYOUT_SYNC=true",
            "TA_CSV_TEST_DATA_PATH=\"C:/Dev/Projects/Work/XXXXXXXXX/YYYYYYYYY-client/data/tas_small.csv\"",
            "TA_PROFILE_LATENCY=false",
            "TA_USE_OLD_FLIP_MODEL=true",
            "UNICODE",
            "VTUNE_PROFILE",
            "WIN32",
            "WIN32_LEAN_AND_MEAN",
            "WIN64",
            "_ENABLE_EXTENDED_ALIGNED_STORAGE",
            "_UNICODE",
            "_WIN64",
            "__STDC_CONSTANT_MACROS",
            "__STDC_FORMAT_MACROS"
          ],
          "compilerPath": "c:/program files/microsoft visual studio/2022/community/vc/tools/msvc/14.32.31326/bin/hostx86/x64/cl.exe",
          "compilerArgs": [],
          "compilerFragments": [
            "/DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1",
            "/EHsc",
            "-Zc:__cplusplus",
            "-permissive-",
            "-utf-8",
            "-std:c++20"
          ]
        }
      }
    ],
    "partialMatches": [],
    "targetCount": 8,
    "executablesCount": 1,
    "librariesCount": 5,
    "targets": [
      {
        "name": "dll_wrapper",
        "type": "STATIC_LIBRARY"
      },
      {
        "name": "XXXXXXXXX",
        "type": "EXECUTABLE"
      },
      {
        "name": "XXXXXXXXX_autogen",
        "type": "UTILITY"
      },
      {
        "name": "XXXXXXXXX_autogen_timestamp_deps",
        "type": "UTILITY"
      },
      {
        "name": "freetype",
        "type": "STATIC_LIBRARY"
      },
      {
        "name": "gfxd3d11_test",
        "type": "STATIC_LIBRARY"
      },
      {
        "name": "libgfx",
        "type": "STATIC_LIBRARY"
      },
      {
        "name": "libgfxd3d11",
        "type": "STATIC_LIBRARY"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": false
    }
  ]
}

sketch34 avatar Jul 27 '22 00:07 sketch34

Same problem on Win11 with "vscodeVersion": "1.70.2", "cmtVersion": "1.11.26". I think @chausner has the hint that these two configurations don't correlate: "activeBuildType": "MinSizeRel", "buildTypesSeen": [ "Debug" ],

artyeffem avatar Aug 23 '22 14:08 artyeffem

I solved the issue by calling cmake -DCMAKE_BUILD_TYPE=Debug <cmakelist_folder> because the variable was not set before (despite triggering the cmake build within VSCode). You can also edit it visually with ccmake. With this, it worked as expected.

maximilianmordig avatar Aug 26 '22 17:08 maximilianmordig

Same issue. Windows, CMake tools, Ninja.

Couldn't get @1621 's solution to work -DCMAKE_BUILD_TYPE=Debug seems to have no effect for me.

jnz86 avatar Aug 31 '22 21:08 jnz86

I meet same issue on ubuntu/gcc, in my case, the problem is caused by 2 line in CMakeLists.txt which defined different BUILD_TYPE again.

set(CMAKE_BUILD_TYPE Release)

set(CMAKE_CXX_FLAGS "-std=c++14 -O3 -DMINIGLOG=ON"),

vscode worked as expected after comment those two lines

ntzzc avatar Sep 01 '22 14:09 ntzzc

This is still an issue as of today, with DEBUG I am still getting this warning message and most importantly the debug buttion isn't working because of this (https://github.com/microsoft/vscode-cmake-tools/issues/1412), people, including me, have fixed the debug button issue by changing DEBUG to Debug. I am on Debian 10 Linux with CMake 3.25.2

qiuxiaomu avatar Mar 04 '23 08:03 qiuxiaomu

I've run into this bug today on Linux - Pop! OS 22.04, VS Code 1.76.2, CMake Tools v1.13.45 and C/C++ v1.14.4. Disabling the C/C++ extension means I can switch CMAKE_BUILD_TYPE. Obviously this isn't really a solution as the C/C++ extension is quite useful!

leoedin avatar Mar 20 '23 15:03 leoedin

Hi, I'm also facing this issue on macOS,

here is the diagnostics log
{
  "os": "darwin",
  "vscodeVersion": "1.78.0",
  "cmtVersion": "1.14.31",
  "configurations": [
    {
      "folder": "/Users/***/***",
      "cmakeVersion": "3.25.0",
      "configured": true,
      "generator": "Xcode",
      "usesPresets": true,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "",
    "buildTypesSeen": [
      "Debug",
      "Release",
      "MinSizeRel",
      "RelWithDebInfo"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 75,
    "executablesCount": 9,
    "librariesCount": 25,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": false
    }
  ]
}

I've already built the solution from the terminal using cmake --preset <preset_name>, so CMake cache is already populated, but I'm still getting this warning.

If it helps,

here is the relevant part of my `CMakePresets.json`
{
  "version": 6,
  "cmakeMinimumRequired": {
    "major": 3,
    "minor": 25,
    "patch": 0
  },
  "configurePresets": [
    {
      "name": "common",
      "hidden": true,
      "binaryDir": "${sourceDir}/build/${presetName}",
      "warnings": {
        "dev": true,
        "uninitialized": true,
        "unusedCli": true
      }
    },
    {
      "name": "macos",
      "hidden": true,
      "generator": "Xcode",
      "cacheVariables": {
        "CMAKE_OSX_ARCHITECTURES": "arm64;x86_64"
      },
      "condition": {
        "type": "equals",
        "lhs": "${hostSystemName}",
        "rhs": "Darwin"
      }
    },
    {
      "name": "debug",
      "hidden": true,
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Debug",
        "CMAKE_CXX_FLAGS": "-DDEBUG_CONFIG",
        "DEBUG_CONFIG": "TRUE"
      }
    },
    {
      "name": "macos-debug",
      "displayName": "macOS-Debug",
      "description": "Debug configuration intended for day-to-day development",
      "inherits": [
        "common",
        "macos",
        "debug"
      ]
    }
  ],
  "buildPresets": [
    {
      "name": "macos-debug",
      "displayName": "macOS-Debug",
      "description": "Debug configuration intended for day-to-day development",
      "configurePreset": "macos-debug"
    }
  ]
}

Thanks!

curldivergence avatar May 06 '23 14:05 curldivergence

Fix is merged in and should be included in the 1.15 release.

andreeis avatar Aug 01 '23 16:08 andreeis

@andreeis still seeing this using v1.17.16. Am I doing something wrong?

CMakePresets.json:

{
  "version": 6,
  "configurePresets": [
    {
      "name": "ninja-multi-vcpkg",
      "hidden": true,
      "generator": "Ninja Multi-Config",
      "binaryDir": "${sourceDir}/out/build/${presetName}",
      "installDir": "${sourceDir}/out/install/${presetName}",
      "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
      "architecture": {
        "value": "x64",
        "strategy": "external"
      },
      "cacheVariables": {
        "VCPKG_HOST_TRIPLET": "${presetName}",
        "VCPKG_TARGET_TRIPLET": "${presetName}"
      }
    },
    {
      "name": "static",
      "hidden": true,
      "cacheVariables": {
        "RLS_STATIC": "ON"
      }
    },
    {
      "name": "x64-mingw-static",
      "description": "MinGW64 w/static linkage",
      "inherits": [
        "ninja-multi-vcpkg",
        "static"
      ]
    },
    {
      "name": "x64-windows-static",
      "description": "MSVC w/static linkage",
      "inherits": [
        "ninja-multi-vcpkg",
        "static"
      ]
    }
  ],
  "buildPresets": [
    {
      "name": "Debug",
      "hidden": true,
      "configuration": "Debug"
    },
    {
      "name": "MinSizeRel",
      "hidden": true,
      "configuration": "MinSizeRel"
    },
    {
      "name": "Release",
      "hidden": true,
      "configuration": "Release"
    },
    {
      "name": "x64-mingw-static-debug",
      "configurePreset": "x64-mingw-static",
      "description": "MinGW64 Debug w/static linkage",
      "inherits": [
        "Debug"
      ]
    },
    {
      "name": "x64-mingw-static-minsizerel",
      "configurePreset": "x64-mingw-static",
      "description": "MinGW64 MinSizeRel w/static linkage",
      "inherits": [
        "MinSizeRel"
      ]
    },
    {
      "name": "x64-mingw-static-release",
      "configurePreset": "x64-mingw-static",
      "description": "MinGW64 Release w/static linkage",
      "inherits": [
        "Release"
      ]
    },
    {
      "name": "x64-windows-static-debug",
      "configurePreset": "x64-windows-static",
      "description": "MSVC Debug w/static linkage",
      "inherits": [
        "Debug"
      ]
    },
    {
      "name": "x64-windows-static-minsizerel",
      "configurePreset": "x64-windows-static",
      "description": "MSVC MinSizeRel w/static linkage",
      "inherits": [
        "MinSizeRel"
      ]
    },
    {
      "name": "x64-windows-static-release",
      "configurePreset": "x64-windows-static",
      "description": "MSVC Release w/static linkage",
      "inherits": [
        "Release"
      ]
    }
  ]
}

Output:

[cpptools] The build configurations generated do not contain the active build configuration. Using "Debug" for CMAKE_BUILD_TYPE instead of "MinSizeRel" to ensure that IntelliSense configurations can be found

HunterZ avatar Feb 25 '24 02:02 HunterZ

Update: This only happens for MinSizeRel.

HunterZ avatar Feb 25 '24 02:02 HunterZ