/WNFramework

A set of cross platform libraries and tools related to game development

Primary LanguageC++BSD 2-Clause "Simplified" LicenseBSD-2-Clause

WNFramework

License

A set of cross platform libraries and tools built for game development.

Development

Currently development is supported on Windows and Linux. Only Windows 10 and Ubuntu 18+ have been tested with the steps laid out in this guide.

Environment

All environment setups assumes you will be developing for all supported targets for that host.

Linux

The following packages are required.

  • build-essential
  • clang
  • cmake
  • libx11-xcb-dev
  • libxcb-keysyms1-dev
  • ninja-build
  • python

Configuration

All configuration is done via CMake. All steps below assume you are within a subfolder called build within the root of the checked out code-base.

Linux

cmake \
  -G[Ninja|"Unix Makefiles"] \
  -DCMAKE_C_COMPILER=[gcc|clang] \ # optional
  -DCMAKE_CXX_COMPILER=[g++|clang++] \ # optional
  -DCMAKE_BUILD_TYPE=[Debug|Release] \
  ../

If CMAKE_C_COMPILER and CMAKE_CXX_COMPILE are omitted CMake will configure against the default system configured compilers. You can also specify specific versions of gcc or clang (gcc-5.0, clang++-4.0, etc.) if you have more then a single version installed and want to target a certain version.

Windows

cmake \
  -G[Ninja|"Visual Studio 14 2015 Win64"|"Visual Studio 15 2017 Win64"|"Visual Studio 16 2019"] \
  -Thost=[x86|x64] \
  -A[Win32|x64] \ # only needed when using Visual Studio 16 2019
  -DCMAKE_BUILD_TYPE=[Debug|Release] \ # only needed when using Ninja
  ../

In order to use the 32-bit variants of the Visual Studio generators simply omit the Win64 from the end. For Visual Studio 2019 you must specify the architecture through the -A command. The CMAKE_BUILD_TYPE is only needed if using Ninja as the generator type. For the Ninja generator you will also need to run the appropriate Visual Studio environment setup script (vcvarsall) in the same command prompt you intend to use for configuration before running a configuration. After you have completed configuration you don't need to re-run this script for subsequent commands. See below scripts for each supported Visual Studio version.

  • 2015: %ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat [x86|amd64]
  • 2017: %ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat [x86|amd64]
  • 2019: %ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat [x86|amd64]

This step may not be required if you only have a single version of Visual Studio installed.

Android

cmake \
  -G[Ninja|"Unix Makefiles"] \
  -DCMAKE_TOOLCHAIN_FILE=[WNFramework Root]\Overlays\Posix\Overlays\Android\android.toolchain.cmake \
  -DWN_ANDROID_ABIS=[arm|arm64|x86] \
  -DWN_ANDROID_SDK=[Android SDK Root] \
  ../

Both the [WNFramework Root] and [Android SDK Root] must be absolute paths. The mips, mips64 and x86-64 toolchains are not currently supported.

Build

All building is done via CMake. All steps below assume you are within a subfolder called build within the root of the code-base and a configuration has already completed successfully

cmake --build .

Visual Studio

If using the command line you will also want to to specify --config [Debug|Release]. If omitted it will build Debug by default. Inside the build folder generated by the Configuration step there is also a WNFramework.sln file that can be used to perform the build but isn't required.

Test

All testing is done via CMake. All steps below assume you are within a subfolder called build within the root of the code-base and a build has already completed successfully.

ctest

Visual Studio

If using the command line you will also want to to specify -C [Debug|Release]. If omitted it will run Debug by default. Inside the build folder generated by the Configuration step there is also a WNFramework.sln file containing a project named RUN_TESTS that can be used to run tests but isn't required.

Coding Conventions

This project uses a number of different languages, for language specific coding conventions check the guides below.