建立新文件夹 && 编译器全面更换为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": [ "configurations": [
{ {
"name": "MinGW", "name": "Win32",
"intelliSenseMode": "clang-x64",
"compilerPath": "C:/Program Files/LLVM/bin/gcc.exe",
"includePath": [ "includePath": [
"${workspaceFolder}" "${workspaceFolder}/**"
], ],
"defines": [], "defines": [
"browse": { "_DEBUG",
"path": [ "UNICODE",
"${workspaceFolder}" "_UNICODE"
], ],
"limitSymbolsToIncludedHeaders": true, "compilerPath": "C:/Program Files/LLVM/bin/clang.exe",
"databaseFilename": "" "cStandard": "c17",
}, "cppStandard": "c++17",
"cStandard": "c11", "intelliSenseMode": "windows-clang-x64"
"cppStandard": "c++17"
} }
], ],
"version": 4 "version": 4

View file

@ -1,26 +1,34 @@
{ {
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "g++.exe", "name": "clang++.exe - 生成和调试活动文件",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe", "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [], "args": [],
"stopAtEntry": false, "stopAtEntry": true,
"cwd": "C:/Project/mingw64/bin",// "cwd": "C:/Program Files/LLVM/bin",
"environment": [], "environment": [],
"externalConsole": false, "externalConsole": true,
"MIMode": "gdb", "MIMode": "gdb",
"miDebuggerPath": "C:\\Project\\mingw64\\bin\\gdb.exe",//gdb "miDebuggerPath": "C:\\Program Files\\LLVM\\bin\\gdb.exe",
"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"//tasks.jsonlabel "preLaunchTask": "Compile"
} }
] ]
} }

View file

@ -5,11 +5,8 @@
"code-runner.runInTerminal": true, // false "code-runner.runInTerminal": true, // false
"code-runner.executorMap": { "code-runner.executorMap": {
"c": "cd $dir && gcc *.c -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 && g++ *.cpp -fexec-charset=gb2312 -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"
// "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"
}, // 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
@ -20,47 +17,15 @@
"C_Cpp.errorSquiggles": "Disabled", // clanglint "C_Cpp.errorSquiggles": "Disabled", // clanglint
"C_Cpp.autocomplete": "Disabled", // clang "C_Cpp.autocomplete": "Disabled", // clang
"clang.cflags": [ // c
"clang.completion.enable": true, "--target=x86_64-w64-mingw",
"files.associations": { "-std=c11",
"iostream": "cpp", "-Wall"
"string": "cpp", ],
"array": "cpp", "clang.cxxflags": [ // c++
"atomic": "cpp", "--target=x86_64-w64-mingw",
"*.tcc": "cpp", "-std=c++17",
"cctype": "cpp", "-Wall"
"clocale": "cpp", ],
"cmath": "cpp", "clang.completion.enable":true // cpptools
"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
} }

View file

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

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
}
}