-
Notifications
You must be signed in to change notification settings - Fork 430
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
Active build configuration warning #2353
Comments
@andreeis can you share the repro for this? And also run |
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 ------- Workspace parsing diagnostics ------- Expand CMake Tools Output Channel[main] Safe constructing new CMakeTools instance Expand CMakePresets.json{ |
Can you also share the |
Of course, I forgot about that one. Expand CMake Log Diagnostics{ |
mac also has this bug too |
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 "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
If I then build in Release mode and switch the config back to "Debug", it shows
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. |
I see this behavior on Windows with MSVC / Ninja generator.
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
}
]
} |
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: |
I solved the issue by calling |
Same issue. Windows, CMake tools, Ninja. Couldn't get @1621 's solution to work |
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 |
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 (#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 |
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! |
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 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! |
Fix is merged in and should be included in the 1.15 release. |
@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:
|
Update: This only happens for |
Bug still here, and IntelliSense was completely borke. |
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.
The text was updated successfully, but these errors were encountered: