-
Notifications
You must be signed in to change notification settings - Fork 50
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.
or clang or gcc.
brew install python3
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 wish to use the vulkan implementation.
If you want to target Web Assembly you will need to install and configure the Emscripten SDK.
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 also supply -libs
this will build third party library dependencies from source.
pmbuild <profile> -libs -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. Some common examples:
msbuild
pmbuild make win32 all /p:Platform=x64 /p:Configuration=Release
xcodebuild
pmbuild make mac all -Configuration=Release
make/emmake
pmbuild make linux all config=release
To see help for the associated toolchain with a profile:
pmbuild make <profile> -help
You can run and launch the example tests as follows:
pmbuild make <profile> all -test
cd pmtech/examples
pmbuild mac -libs -all
cd build/osx
open examples_osx.xcworkspace
cd pmtech/examples
pmbuild mac-gl -libs -all
cd build/osx
open examples_osx.xcworkspace
cd examples
pmbuild mac-ci -libs -all
cd build/osx
make config=release
cd examples
pmbuild linux -libs -all
cd build/linux
make config=release
cd examples
pmbuild win32 -libs -all
cd examples
pmbuild win32-vulkan -libs -all
cd examples
pmbuild win32-gl -libs -all
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.
You can add a jsn member to the win32 build profile to force select a different visual studio version:
win32(base):
{
vc_version: "latest", // supported options: latest, vs2017, vs2019
}
cd examples
pmbuild ios -libs -all
cd build/ios
open examples.xcworkspace
cd examples
pmbuild android -libs -all
cd build/android
open in android studio
Make sure to setup emsdk_env first.
cd examples
pmbuild <win32/mac/linux> -libs
pmbuild web -all
cd build/web
emmake make
pmtech contains a tools project which contains a mesh optimised and a graphical editor, to build these use the same process as building the examples but instead navigate to 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.