重配编译工具链

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",
"_UNICODE" "_UNICODE"
], ],
"compilerPath": "C:/Program Files/LLVM/bin/clang.exe",
"cStandard": "c17", "cStandard": "c17",
"cppStandard": "c++17", "cppStandard": "c++17",
"intelliSenseMode": "windows-clang-x64" "intelliSenseMode": "windows-gcc-x64",
"compilerPath": "C://Project/LLVM/bin/gcc.exe"
} }
], ],
"version": 4 "version": 4

View file

@ -1,34 +1,26 @@
{ {
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "clang++.exe - 生成和调试活动文件", "name": "gdb",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe", "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [], "args": [],
"stopAtEntry": true, "stopAtEntry": true, // truetrue
"cwd": "C:/Program Files/LLVM/bin", "cwd": "C:/Project/LLVM/bin",//
"environment": [], "environment": [],
"externalConsole": true, "externalConsole": true, // true
"MIMode": "gdb", "MIMode": "gdb",
"miDebuggerPath": "C:\\Program Files\\LLVM\\bin\\gdb.exe", "miDebuggerPath": "C:\\Project\\LLVM\\bin\\gdb.exe",//gdb
"setupCommands": [ "setupCommands": [
{ {
"description": "gdb 启用整齐打印", "description": "gdb",
"text": "-enable-pretty-printing", "text": "-enable-pretty-printing",
"ignoreFailures": true "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.runInTerminal": true, // false
"code-runner.executorMap": { "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", // "c": "cd $dir && gcc *.c -o $fileNameWithoutExt.exe && $dir$fileNameWithoutExt.exe",
"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" // "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
"code-runner.saveFileBeforeRun": true, // run code "code-runner.saveFileBeforeRun": true, // run code
"code-runner.preserveFocus": true, // falserun codefalse "code-runner.preserveFocus": true, // falserun codefalse
@ -14,18 +18,19 @@
"C_Cpp.clang_format_sortIncludes": true, // include "C_Cpp.clang_format_sortIncludes": true, // include
"C_Cpp.intelliSenseEngine": "Default", // DefaultTag Parsercpptools "C_Cpp.intelliSenseEngine": "Default", // DefaultTag Parsercpptools
"C_Cpp.errorSquiggles": "Disabled", // clanglint // "C_Cpp.errorSquiggles": "Disabled", // clanglint
"C_Cpp.autocomplete": "Disabled", // clang // "C_Cpp.autocomplete": "Disabled", // clang
"clang.cflags": [ // c // "clang.cflags": [ // c
"--target=x86_64-w64-mingw", // "--target=x86_64-w64-mingw",
"-std=c11", // "-std=c11",
"-Wall" // "-Wall"
], // ],
"clang.cxxflags": [ // c++ // "clang.cxxflags": [ // c++
"--target=x86_64-w64-mingw", // "--target=x86_64-w64-mingw",
"-std=c++17", // "-std=c++17",
"-Wall" // "-Wall"
], // ],
"clang.completion.enable":true // cpptools // "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 // https://code.visualstudio.com/docs/editor/tasks
{ {
"version": "2.0.0", "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": [ "tasks": [
{ {
"label": "Compile", // launch.jsonpreLaunchTask "label": "Compile", // launch.jsonpreLaunchTask
"command": "clang++", // 使 "command": "g++", // 使
"args": [ "args": [
"${file}", "${fileDirname}\\*.cpp",//
"-o", // a.exe "-g",//
"${fileDirname}/${fileBasenameNoExtension}.exe", "-o",
"-g", // "${fileDirname}\\${fileBasenameNoExtension}.exe"
"-Wall", //
"-static-libgcc", //
"-fcolor-diagnostics",
"--target=x86_64-w64-mingw", // targetmsvc
"-std=c++17" // Cc11
], // ], //
"type": "shell", "type": "shell",
"group": { "group": {