建立新文件夹 && 编译器全面更换为clang

This commit is contained in:
iridiumR 2022-03-11 16:43:27 +08:00
parent 5f9eea8938
commit 7edbb7b447
11 changed files with 244 additions and 87 deletions

View file

@ -1,22 +1,19 @@
{
"configurations": [
{
"name": "MinGW",
"intelliSenseMode": "clang-x64",
"compilerPath": "C:/Program Files/LLVM/bin/gcc.exe",
"name": "Win32",
"includePath": [
"${workspaceFolder}"
"${workspaceFolder}/**"
],
"defines": [],
"browse": {
"path": [
"${workspaceFolder}"
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"cStandard": "c11",
"cppStandard": "c++17"
"compilerPath": "C:/Program Files/LLVM/bin/clang.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-clang-x64"
}
],
"version": 4

View file

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

View file

@ -5,11 +5,8 @@
"code-runner.runInTerminal": true, // false
"code-runner.executorMap": {
"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"
// "cpp": "cd $dir && clang++ *.cpp -o $fileNameWithoutExt.exe -Wall -g -Og -static-libgcc -fcolor-diagnostics --target=x86_64-w64-mingw -std=c++14 && $dir$fileNameWithoutExt"
"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
@ -20,47 +17,15 @@
"C_Cpp.errorSquiggles": "Disabled", // clanglint
"C_Cpp.autocomplete": "Disabled", // clang
"clang.completion.enable": true,
"files.associations": {
"iostream": "cpp",
"string": "cpp",
"array": "cpp",
"atomic": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"optional": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"typeinfo": "cpp"
} // 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 // cpptools
}

View file

@ -1,24 +1,33 @@
// https://code.visualstudio.com/docs/editor/tasks
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "Compile",//launch.jsonpreLaunchTask
"command": "g++",
"label": "Compile", // launch.jsonpreLaunchTask
"command": "clang++", // 使
"args": [
"${fileDirname}\\*.cpp",//
"-g",//
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "C:/Project/mingw64/bin"//
"${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
},
"problemMatcher": [
"$gcc"
],
"group": "build",
"detail": "编译器: C:/Project/mingw64/bin/g++.exe"
"presentation": {
"echo": true,
"reveal": "always", // alwayssilentneverVSC
"focus": false, // true使taskcc++true
"panel": "shared" //
}
],
"version": "2.0.0"
// "problemMatcher":"$gcc" // 使clang)
}
]
}

View file

@ -0,0 +1,20 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:/Program Files/LLVM/bin/clang.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-clang-x64"
}
],
"version": 4
}

34
SoftwareDesign/.vscode/launch.json vendored Normal file
View file

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

31
SoftwareDesign/.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,31 @@
{
"files.defaultLanguage": "cpp", // ctrl+N
"editor.formatOnType": true, //
"editor.snippetSuggestions": "top", // snippets
"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"
}, // code runner
"code-runner.saveFileBeforeRun": true, // run code
"code-runner.preserveFocus": true, // falserun codefalse
"code-runner.clearPreviousOutput": false, // run codecode runner
"C_Cpp.clang_format_sortIncludes": true, // include
"C_Cpp.intelliSenseEngine": "Default", // DefaultTag Parsercpptools
"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
}

33
SoftwareDesign/.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,33 @@
// 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)
}
]
}

View file

@ -0,0 +1,6 @@
#include <stdio.h>
int main()
{
printf("hello world");
return 0;
}

1
SoftwareDesign/README.md Normal file
View file

@ -0,0 +1 @@
# 软件设计综合实验 课程作业

View file

@ -0,0 +1,53 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"files.associations": {
"iostream": "cpp",
"*.tcc": "cpp",
"string": "cpp",
"string_view": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"istream": "cpp",
"array": "cpp",
"atomic": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"optional": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"typeinfo": "cpp",
"ctime": "cpp",
"iomanip": "cpp"
},
"commentTranslate.hover.enabled": true
}
}