重配编译工具链

This commit is contained in:
iridiumR 2022-03-11 20:55:47 +08:00
parent ea2c627324
commit 09379a8cf3
4 changed files with 63 additions and 42 deletions

View file

@ -10,10 +10,10 @@
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:/Program Files/LLVM/bin/clang.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-clang-x64"
"intelliSenseMode": "windows-gcc-x64",
"compilerPath": "C://Project/LLVM/bin/gcc.exe"
}
],
"version": 4

View file

@ -1,34 +1,26 @@
{
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "clang++.exe - 生成和调试活动文件",
"name": "gdb",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": true,
"cwd": "C:/Program Files/LLVM/bin",
"stopAtEntry": true, // truetrue
"cwd": "C:/Project/LLVM/bin",//
"environment": [],
"externalConsole": true,
"externalConsole": true, // true
"MIMode": "gdb",
"miDebuggerPath": "C:\\Program Files\\LLVM\\bin\\gdb.exe",
"miDebuggerPath": "C:\\Project\\LLVM\\bin\\gdb.exe",//gdb
"setupCommands": [
{
"description": "gdb 启用整齐打印",
"description": "gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "将反汇编风格设置为 Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "Compile"
"preLaunchTask": "Compile"//tasks.jsonlabel
}
]
}

View file

@ -5,8 +5,12 @@
"code-runner.runInTerminal": true, // false
"code-runner.executorMap": {
"c": "cd $dir && clang $fileName -o $fileNameWithoutExt.exe -Wall -g -Og -static-libgcc -fcolor-diagnostics --target=x86_64-w64-mingw -std=c11 && $dir$fileNameWithoutExt",
"cpp": "cd $dir && clang++ *.cpp -o $fileNameWithoutExt.exe -Wall -g -Og -static-libgcc -fcolor-diagnostics --target=x86_64-w64-mingw-g++ -std=c++17 && $dir$fileNameWithoutExt"
// "c": "cd $dir && gcc *.c -o $fileNameWithoutExt.exe && $dir$fileNameWithoutExt.exe",
// "cpp": "cd $dir && g++ *.cpp -o $fileNameWithoutExt.exe && $dir$fileNameWithoutExt.exe"
"c": "cd $dir && gcc *.c -fexec-charset=gb2312 -o $fileNameWithoutExt.exe && $dir$fileNameWithoutExt.exe",
"cpp": "cd $dir && g++ *.cpp -fexec-charset=gb2312 -o $fileNameWithoutExt.exe && $dir$fileNameWithoutExt.exe"
// "c": "cd $dir && clang $fileName -o $fileNameWithoutExt.exe -Wall -g -Og -static-libgcc -fcolor-diagnostics --target=x86_64-w64-mingw -std=c11 && $dir$fileNameWithoutExt",
// "cpp": "cd $dir && clang++ *.cpp -o $fileNameWithoutExt.exe -Wall -g -Og -static-libgcc -fcolor-diagnostics --target=x86_64-w64-mingw-g++ -std=c++17 && $dir$fileNameWithoutExt"
}, // code runner
"code-runner.saveFileBeforeRun": true, // run code
"code-runner.preserveFocus": true, // falserun codefalse
@ -14,18 +18,19 @@
"C_Cpp.clang_format_sortIncludes": true, // include
"C_Cpp.intelliSenseEngine": "Default", // DefaultTag Parsercpptools
"C_Cpp.errorSquiggles": "Disabled", // clanglint
"C_Cpp.autocomplete": "Disabled", // clang
// "C_Cpp.errorSquiggles": "Disabled", // clanglint
// "C_Cpp.autocomplete": "Disabled", // clang
"clang.cflags": [ // c
"--target=x86_64-w64-mingw",
"-std=c11",
"-Wall"
],
"clang.cxxflags": [ // c++
"--target=x86_64-w64-mingw",
"-std=c++17",
"-Wall"
],
"clang.completion.enable":true // cpptools
// "clang.cflags": [ // c
// "--target=x86_64-w64-mingw",
// "-std=c11",
// "-Wall"
// ],
// "clang.cxxflags": [ // c++
// "--target=x86_64-w64-mingw",
// "-std=c++17",
// "-Wall"
// ],
// "clang.completion.enable": true,
"C_Cpp.default.compilerPath": "C:/Program Files/LLVM/bin/gcc.exe" // cpptools
}

View file

@ -1,20 +1,44 @@
// https://code.visualstudio.com/docs/editor/tasks
{
"version": "2.0.0",
// "tasks": [
// {
// "label": "Compile", // launch.jsonpreLaunchTask
// "command": "clang++", // 使
// "args": [
// "${file}",
// "-o", // a.exe
// "${fileDirname}/${fileBasenameNoExtension}.exe",
// "-g", //
// "-Wall", //
// "-static-libgcc", //
// "-fcolor-diagnostics",
// "--target=x86_64-w64-mingw", // targetmsvc
// "-std=c++17" // Cc11
// ], //
// "type": "shell",
// "group": {
// "kind": "build",
// "isDefault": true // falsetasks.json
// },
// "presentation": {
// "echo": true,
// "reveal": "always", // alwayssilentneverVSC
// "focus": false, // true使taskcc++true
// "panel": "shared" //
// }
// // "problemMatcher":"$gcc" // 使clang)
// }
// ]
"tasks": [
{
"label": "Compile", // launch.jsonpreLaunchTask
"command": "clang++", // 使
"command": "g++", // 使
"args": [
"${file}",
"-o", // a.exe
"${fileDirname}/${fileBasenameNoExtension}.exe",
"-g", //
"-Wall", //
"-static-libgcc", //
"-fcolor-diagnostics",
"--target=x86_64-w64-mingw", // targetmsvc
"-std=c++17" // Cc11
"${fileDirname}\\*.cpp",//
"-g",//
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
], //
"type": "shell",
"group": {