-
Notifications
You must be signed in to change notification settings - Fork 49
Building
To build pmtech for different platforms pmbuild is used to generate projects/makefiles, game ready data and also build code from the command line. pmbuild originated in pmtech but has since moved to it's own repository which contains more detailed documentation. You can run pmbuild from the pmtech directory, or if you add the pmtech directory to your path this will allow you to simply run pmbuild
.
pmtech only needs minimal external dependencies, just a c++ compiler and python3.
Users who want to use OpenGL or Vulkan require vcredist 2013 for the glsl/spirv validator.
Note for Windows users, if you see this message during the build:
"Cannot find 'vcvarsall.exe'"
"Please enter the full path to the vc installation directory containing vcvarsall.exe"
You must have Visual Studio 2017 or 2019 installed, pmbuild will try and find visual studio installations and select the latest version of visual studio and windows sdk by default.
Xcode, clang or gcc.
brew install python3
sudo apt install make
sudo apt-get install python3
sudo apt-get install libglew-dev
sudo apt-get install gcc-7 g++-7
or clang.
If you want to target Vulkan please ensure you have the Vulkan SDK installed and the VK_SDK_PATH variable is set.
If you want to target Web Assembly you will need to install and configure the Emscripten SDK for your desired platform.
pmtech uses submodules so please ensure to clone recursively:
git clone https://github.com/polymonster/pmtech.git --recursive
From time to time submodules may be updated or new ones may be added you can update and init submodules as follows from within the pmtech directory:
cd pmtech
git submodule update --init --recursive
Navigate to the pmtech/examples directory:
cd pmtech/examples
You can see all available pmbuild profiles by running:
pmbuild -help
--------------------------------------------------------------------------------
pmbuild (v4) -------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
pmbuild version 4.0 -help -----------------------------------------------------
--------------------------------------------------------------------------------
usage: pmbuild <profile> <tasks...>
pmbuild make <target> <args...>
pmbuild launch <target> <args...>
options:
-help (display this dialog).
<profile> -help (display help for the chosen profile).
make <profile> -help (display help for the chosen make toolchain).
<profile> <tasks...> -help (display help for the chosen tasks).
-cfg (print jsn config for current profile).
-verbose (print more).
-all (build all tasks).
-<task> (build specified tasks by name or by type).
-n<task> (exclude specified tasks).
profiles:
config.jsn (edit task settings in here)
base
mac
mac-gl
win32
win32-vulkan
win32-gl
ios
ios-ci
linux
linux-vulkan
web
android
extensions
tools_help
Choose a build profile you want to build for and on the first run build -libs
first this will build third party library dependencies from source.
pmbuild <profile> -libs
pmbuild <profile> -all
After the first time building you should not need to supply -libs
again unless the libraries need updating.
Once built, Xcode workspaces, Visual Studio solutions or make files will be generated in the examples/build
folder.
you can build code using xcode or visual studio, but you can build also the examples from the command line using pmbuild make
as follows:
pmbuild make <profile> all
When running pmbuild make
you will be using a platform specific toolchain so can supply any specific arguments as well. To see help for the associated toolchain with a profile:
pmbuild make <profile> -help
You can supply all
to build all targets in the build directory, or specify a single target.
pmbuild make win32 all /p:Platform=x64 /p:Configuration=Release
pmbuild make mac all -configuration Release
pmbuild make linux all config=release
You can run and launch the example tests again supply all
to run all tests:
pmbuild launch <profile> all -test
pmtech contains a tools project which contains a graphical editor, to build these tools use the same process as building the examples but instead navigate to pmtech/tools
:
cd pmtech/tools
pmbuild <profile>-editor
From within the pmtech tools solution or workspace, build and run pmtech_editor. Edit code in live_lib.cpp and then build the live_lib project inside the tools solution. Code changes will be dynamically reloaded for rapid development.
cd pmtech/examples
pmbuild mac -libs
pmbuild mac -all
pmbuild make mac all
cd pmtech/examples
pmbuild mac-gl -libs
pmbuild mac-gl -all
pmbuild make mac-gl all
cd pmtech/examples
pmbuild linux -libs
pmbuild linux -all
pmbuild make linux all
cd pmtech/examples
pmbuild win32 -libs
pmbuild win32 -all
pmbuild make win32 all /p:Platform=x64
cd pmtech/examples
pmbuild win32-vulkan -libs
pmbuild win32-vulkan -all
pmbuild make win32-vulkan all /p:Platform=x64
cd pmtech/examples
pmbuild win32-gl -libs
pmbuild win32-gl -all
pmbuild make win32-gl all /p:Platform=x64
cd pmtech/examples
pmbuild ios -libs
pmbuild ios -all
pmbuild make ios all
cd pmtech/examples
pmbuild android -libs
pmbuild android -all
cd build/android
open in android studio
Make sure to setup emsdk_env first.
cd pmtech/examples
pmbuild web -libs
pmbuild web -all
pmbuild make web all