-
Notifications
You must be signed in to change notification settings - Fork 2
Guide to contributing, Building code using CMake
As you may know, building code is important to test for bugs or to ship the code to the public. But for people who may not use tools like CMake, here's the way to build code. And the example will be based from Ciyac.
Firstly, to build code, you must install CMake; if you haven't, depending on the OS, you can follow these instructions:
winget install Kitware.CMake/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # To if have no brew installed
brew install cmake# Example: Ubuntu
sudo apt install cmake # It's that easy, no need for long commandsNow, if it's installed, we'll build the code, but first, write the CMakeLists.txt, but Ciyac already has the CMake list, so you don't have to worry.
Now, after you write the CMakeLists.txt, you just need to type:
cmake -S . -B build # you can type: "cmake -B build"
cmake --build buildBut if you wanna debug things like using gdb, you may run:
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build
gdb build/ciya # may replace it with correct pathAnd lastly, it'll be different between OS, but for Linux, run:
./build/ciya And for Windows, it's
./build/Debug/ciyaBut it could be different, so just randomly search for the binary.
I hope the guide helps, but if you have any problems or questions, I'll reply in a few hours to a few days. But, hope you have a good day =).
The original creator, Johnryzon Z. Abejero
Contributor:
- Nguyễn Phước Thành Lâm
Copyright (C) 2026 Johnryzon Z. Abejero, Nguyễn Phước Thành Lâm