Skip to content

The block puzzle video game that's all the rage with the ten people I've told

License

Notifications You must be signed in to change notification settings

ssrobins/stackblox

Repository files navigation

Building happiness in your life...with StackBlox

I couldn't find a simple C++ CMake/Conan build setup with continuous integration that uses the latest compilers and builds a shippable application on mobile and desktop platforms so I made one! And in the process, I also made StackBlox. I even did a CppCon lightning talk.

Whoa, I didn't sign up for this code stuff, I just want to play the game!

Get StackBlox now (it's free and ad-free)

Building StackBlox

Required tools

If you want to build from source, download the latest versions of the following tools:

Then, Clone this repo

Build

The whole development workflow is driven by CMake presets to make it easy to select all the supported configurations! Presets are defined in CMakePresets.json. In the preset names, you'll see references to the platform name, build configuration, and Iwyu, which runs the Include What You Use check.

Build with the CMake GUI

  1. Open the CMake GUI
  2. Click Browse Source... and navigate to the repo
  3. Click the Preset dropdown and select the platform you want to build
  4. Click Generate
  5. For Visual Studio and Xcode, click Open Project to launch the project in the IDE. For Android, the button is grayed out, but you can open Android Studio and select the project in AndroidStudio/StackBlox from the CMake binary folder.
  6. Build from the IDE as you normally would

Build at the command line

  1. At the command line, cd to the repo
  2. Run cmake --workflow --list-presets to see available presets
  3. Run cmake --workflow --preset=<preset-name> to run the full CMake workflow for that build (example: macOS build/test/packaging with release build config would be cmake --workflow --preset=macosRelease).

Continuous integration (CI)

The build process is automated through GitHub Actions, defined in the main.yml file. Nothing fancy here, it runs CMake's configure, build, test, and package commands and archives the results.

Build environments

All the builds run on the Windows, Linux, and macOS build environments provided by GitHub. More information at https://github.com/actions/runner-images.

Conan packages

The Conan packages used in StackBlox are listed in conanfile.py and originate from ConanCenter. For more details, check out https://github.com/conan-io/conan-center-index.