C & C++ Routines, Typedefines, Classes, Templates, etc... that I needed over the years to simplify my workflows
for ABI Compatibility, it is recommended to use the included C Headers and to also compile the project as a dependency (Git Submodule, ...)
See docs.md for API Documentation
The project structure is the same as my premake5-workspace-template, except that I use CMake instead
- CMake
- Working compiler toolchain, preferably clang
- Windows: You should use llvm
- Linux:
- installing-specific-llvm-version
- configuring-symlinks
- You Don't have to use LLVM, gcc works too
git clone https://github.com/inonitz/util2/util2.git desired_folder_path_from_cwdFor Conciseness, I also include simple build steps with compile_commands.json:
cd desired_folder_path_from_cwd/util2
mkdir -p ../build
cmake -S . -B ../build -G 'Ninja' \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_SHARED_LIBS=0
cd ../build
cp "compile_commands.json" "../compile_commands_dest/compile_commands.json"
ninja $PROJECT_NAMEIn a single line for copying:
cd util2 && mkdir -p ../build && cmake -S . -B ../build -G 'Ninja' -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 && cd ../build && ninja util2 && cd ../
In your CmakeLists.txt:
add_subdirectory(your_directory/util2)git submodule add https://github.com/inonitz/util2 your_dependency_folder/util2
git submodule init
git submodule updateIn your CmakeLists.txt:
add_subdirectory(your_dependency_folder/util2)If you have a suggestion, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Distributed under the MIT License. See LICENSE file for more information.