diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..06ea346 --- /dev/null +++ b/.clang-format @@ -0,0 +1,4 @@ +--- +Language: Cpp +BasedOnStyle: Google +... diff --git a/.gitignore b/.gitignore index 45e4fe7..33876d7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ bazel-out bazel-testlogs bazel-zalgo bazel-zpplib + diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 14591be..51b550c 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -3,14 +3,15 @@ { "name": "Mac", "includePath": [ - "${workspaceFolder}/**" + "${workspaceFolder}/**", + "${workspaceFolder}/bazel-zpplib/external/com_google_absl" ], "defines": [], "macFrameworkPath": [ "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks" ], "compilerPath": "/usr/bin/clang", - "cStandard": "c14", + "cStandard": "c11", "cppStandard": "c++14", "intelliSenseMode": "macos-clang-x64" } diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a3b2b51 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "vector": "cpp" + } +} \ No newline at end of file diff --git a/README.md b/README.md index 6a5944d..f861bc0 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,19 @@ 进入这个项目目录,运行 ` bazel run //:hello_world ` +# 使用本项目 + +在你的WORKSPACE文件中加入以下内容: +```bazel +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "com_google_absl", + urls = ["https://github.com/abseil/abseil-cpp/archive/98eb410c93ad059f9bba1bf43f5bb916fc92a5ea.zip"], + strip_prefix = "abseil-cpp-98eb410c93ad059f9bba1bf43f5bb916fc92a5ea", +) +``` + +df07cfd7df8dd9063cf523d0a85cf4d125b92fd4 + +# 维护 diff --git a/WORKSPACE b/WORKSPACE index 56b0919..4412e9a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,3 +1,5 @@ +workspace(name = "person_notfresh_zpplib") + load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( diff --git a/hello.cpp b/hello.cpp index 3bb7acb..eddc2ba 100644 --- a/hello.cpp +++ b/hello.cpp @@ -1,3 +1,16 @@ +/** + * @file hello.cpp + * + * 参考 https://abseil.io/docs/cpp/quickstart + * + * @author zhengxu + * @brief + * @version 0.1 + * @date 2024-04-03 + * + * @copyright Copyright (c) 2024 + * + */ #include #include #include