Solved. Visual Studio’s cmake support is buggy. I try to change the CMAKE_BUILD_TYPE in the Visual Studio generated CmakeSettings.json file, and it generates error of the variable has been defined multiple times. I checked the text version of the json file and corrected it manually, and it’s all good now.