GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - owent/atframe_utils: cxx utils code

BranchesTags
Open more actions menu

Latest commit

 

History

1,361 Commits
1,361 Commits

Folders and files

NameName
Last commit message
Last commit date
.agents/skills
.agents/skills
 
 
.github
.github
 
 
atframework
atframework
 
 
ci
ci
 
 
include
include
 
 
project/cmake
project/cmake
 
 
sample
sample
 
 
src
src
 
 
test
test
 
 
third_party
third_party
 
 
tools
tools
 
 
.clang-format
.clang-format
 
 
.clang-tidy
.clang-tidy
 
 
.clang-tidy.light
.clang-tidy.light
 
 
.cmake-format.yaml
.cmake-format.yaml
 
 
.codechecker.clang-tidy.args
.codechecker.clang-tidy.args
 
 
.codechecker.skipfile
.codechecker.skipfile
 
 
.codechecker.yaml
.codechecker.yaml
 
 
.flake8
.flake8
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.pylintrc
.pylintrc
 
 
.scan-build.disable
.scan-build.disable
 
 
.scan-build.enable
.scan-build.enable
 
 
AGENTS.md
AGENTS.md
 
 
CLAUDE.md
CLAUDE.md
 
 
CMakeLists.txt
CMakeLists.txt
 
 
CPPLINT.cfg
CPPLINT.cfg
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
atframe_utils-config.cmake.in
atframe_utils-config.cmake.in
 
 
cmake_dev.bat
cmake_dev.bat
 
 
cmake_dev.ps1
cmake_dev.ps1
 
 
cmake_dev.sh
cmake_dev.sh
 
 
codecov.yml
codecov.yml
 
 
lgtm.yml
lgtm.yml
 
 
llvm.clang-format
llvm.clang-format
 
 
requirements-python-dev.txt
requirements-python-dev.txt
 
 

Repository files navigation

atframe_utils

cxx utils code

ci-badge codeql-badge codecov badge license-badge

CI Job Matrix

Target System Toolchain Note
Linux GCC -
Linux GCC With MbedTLS
Linux Clang With libc++
MinGW64 GCC Static linking
MinGW64 GCC Dynamic linking
Windows Visual Studio 2026 Static linking
Windows Visual Studio 2026 Dynamic linking
macOS AppleClang With libc++

Usage

  • require cmake 3.24.0 or upper
  • require gcc 7.1+/clang 7+/apple clang 12.0+/MSVC(VS2022+)
# clone and make build directory
git clone --single-branch --depth=1 -b master https://github.com/atframework/atframe_utils.git
mkdir atframe_utils/build && cd atframe_utils/build

# run cmake
# cmake <atframe_utils dir> [options...]
cmake .. -DPROJECT_ENABLE_SAMPLE=YES -DPROJECT_ENABLE_UNITTEST=YES -DPROJECT_ENABLE_TOOLS=ON #  -DCMAKE_INSTALL_PREFIX=<install prefix>

# build
cmake --build . # using clang or gcc
# cmake --build . --config RelWithDebInfo # using MSVC

# run unit test
ctest . -V

# run unit test
cmake --build . --target INSTALL # using clang or gcc
# cmake --build . --config RelWithDebInfo --target INSTALL # using MSVC

XXTEA padding

crypto::cipher::get_block_size() returns 8 for XXTEA. Both encrypt and decrypt require a nonempty input whose length is a multiple of 8 bytes; invalid lengths return error_code_t::kInvalidParam before writing output. Callers pad plaintext before encryption and retain its original length for trimming after decryption. An 8-byte block contains two 32-bit XXTEA words, avoiding the invalid single-word path.

Incremental build hygiene

Code and resources consumed by CMake targets must not be touched or overwritten when content is unchanged, including generated and copied files. Declare real OUTPUT, BYPRODUCTS, DEPENDS, and DEPFILE relationships, and use content-stable generation or temporary output plus cmake -E copy_if_different. Only a dedicated stamp that is not a compiled or packaged input may be touched unconditionally.

Clangd 配置参考

本仓库默认使用 build_jobs_cmake_tools 作为编译数据库目录(由 CMake 生成 compile_commands.json)。建议保持与当前设置一致:

.clangd(可选)

CompileFlags:
	CompilationDatabase: build_jobs_cmake_tools

Index:
	Background: Build

Diagnostics:
	UnusedIncludes: Strict

VS Code settings

{
	"C_Cpp.intelliSenseEngine": "disabled",
	"clangd.enable": true,
	"clangd.arguments": [
		"--compile-commands-dir=${workspaceFolder}/build_jobs_cmake_tools",
		"--background-index",
		"--clang-tidy",
		"--completion-style=detailed",
		"--header-insertion=iwyu",
		"-j=8"
	]
}

MSVC + clangd --query-driver 推荐配置

当使用 MSVC 工具链时,建议显式配置 --query-driver 以便 clangd 正确读取 MSVC 的系统头与内置宏:

{
	"clangd.arguments": [
		// 使用环境变量(推荐,VS 开发者命令行会注入 VCToolsInstallDir)
		"--query-driver=${env:VCToolsInstallDir}bin/Hostx64/x64/cl.exe",

		// 通配符版本(多个版本时会选择第一个匹配项)
		"--query-driver=C:/Program Files/Microsoft Visual Studio/*/Community/VC/Tools/MSVC/*/bin/Hostx64/x64/cl.exe"
	]
}

显式指定 C++ 标准(CMake 配置)

如果需要固定 __cplusplus 版本,可通过 CMake 统一指定标准(示例:C++20):

{
	"cmake.configureSettings": {
		"CMAKE_CXX_STANDARD": "20",
		"CMAKE_CXX_STANDARD_REQUIRED": "ON"
	}
}

说明:只有在 MSVC 下 clangd 不识别 -std:c++latest 和 /std:c++latest 时,才需要使用以上方式固定标准。使用 CMAKE_CXX_STANDARD 通常兼容性更好;--query-driver 不影响单独打开的 .h 文件,仅影响带编译命令的翻译单元。两者可二选一使用。

Other options

Option Description
BUILD_SHARED_LIBS=YES|NO [default=NO] Build dynamic library
LIBUNWIND_ENABLED=YES|NO [default=NO] Enable and using libunwind for callstack unwind
LOG_WRAPPER_ENABLE_LUA_SUPPORT=YES|NO [default=YES] Enable lua support for log system
LOG_WRAPPER_CHECK_LUA=YES|NO [default=YES] Enable checking for lua support
LOG_WRAPPER_ENABLE_STACKTRACE=YES|NO [default=YES] Enable stack trace for log system
ENABLE_MIXEDINT_MAGIC_MASK=0-8 [default=0] Set mixed int mask
CRYPTO_DISABLED=YES|NO [default=NO] Disable crypto and DH/ECDH support
CRYPTO_USE_OPENSSL=YES|NO [default=NO] Using openssl for crypto and DH/ECDH support, and close auto detection
CRYPTO_USE_MBEDTLS=YES|NO [default=NO] Using mbedtls for crypto and DH/ECDH support, and close auto detection

About

cxx utils code

Resources

Readme
MIT license
Activity

Stars

85 stars

Watchers

8 watching

Forks

33 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.