初版。
This commit is contained in:
23
res/template/cmake/.clang-format
Normal file
23
res/template/cmake/.clang-format
Normal file
@@ -0,0 +1,23 @@
|
||||
BasedOnStyle: LLVM
|
||||
IndentWidth: 4
|
||||
PointerAlignment: Left
|
||||
AccessModifierOffset: -4
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterFunction: true
|
||||
AfterClass: true
|
||||
Cpp11BracedListStyle: true
|
||||
ReflowComments: true
|
||||
SpacesBeforeTrailingComments: 3
|
||||
TabWidth: 4
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ColumnLimit: 110
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
IncludeBlocks: Regroup
|
||||
IncludeCategories:
|
||||
- Regex: '^<.*>'
|
||||
Priority: 1
|
||||
- Regex: '^".*"'
|
||||
Priority: 2
|
||||
16
res/template/cmake/.clangd
Normal file
16
res/template/cmake/.clangd
Normal file
@@ -0,0 +1,16 @@
|
||||
Hover:
|
||||
ShowAKA: Yes
|
||||
CompileFlags:
|
||||
Remove: [-fexec-charset=gbk]
|
||||
Diagnostics:
|
||||
UnusedIncludes: None # 禁用未使用头文件提示
|
||||
Suppress: [
|
||||
anon_type_definition, # 禁用匿名的typedef提示
|
||||
unused-variable, # 禁用未使用变量提示
|
||||
unused-function, # 禁用未使用函数提示
|
||||
unused-includes, # 禁用未使用的头文件提示
|
||||
unused-parameter,
|
||||
builtin_definition # clang 显示 mingw windows.h 中 definition of builtin function '__rdtsc
|
||||
]
|
||||
ClangTidy:
|
||||
Remove: misc-unused-alias-decls
|
||||
14
res/template/cmake/CMakeLists.txt
Normal file
14
res/template/cmake/CMakeLists.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(replace LANGUAGES CXX)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if (MSVC)
|
||||
add_compile_options(/source-charset:utf-8)
|
||||
endif()
|
||||
|
||||
message(STATUS "System: ${CMAKE_SYSTEM_NAME}")
|
||||
message(STATUS "Compiler CXX ID: ${CMAKE_CXX_COMPILER_ID}")
|
||||
|
||||
add_executable(replace main.cpp)
|
||||
7
res/template/cmake/main.cpp
Normal file
7
res/template/cmake/main.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Done" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user