Skip to content

Commit 8085a94

Browse files
committed
Merge branch 'release/1.6.4'
2 parents 8a05644 + dc1510f commit 8085a94

29 files changed

+422
-235
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ If applicable, add screenshots to help explain your problem.
2424

2525
**Desktop (please complete the following information):**
2626
- OS: [e.g. mac/linux/windows]
27-
- Version [e.g. 1.6.3]
27+
- Version [e.g. 1.6.4]
2828

2929
**Additional context**
3030
Add any other context about the problem here.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,7 @@ test-output.xml
147147
**/cmake-build*
148148

149149
python/testdir/
150+
.cmake/
151+
griddlyConfig.cmake
152+
griddlyConfigVersion.cmake
153+

CMakeLists.txt

Lines changed: 38 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.18.0)
22
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version")
3-
project(Griddly VERSION 1.6.3)
3+
project(Griddly VERSION 1.6.4)
44

55
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWERCASE)
66

@@ -40,12 +40,6 @@ set(GRIDDLY_TEST_SRC_DIR ${GRIDDLY_TEST_DIR}/src)
4040
# project resources folder (e.g. map files, shaders, configs etc.)
4141
set(GRIDDLY_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources)
4242

43-
# the dependency folder specifying all required libs for conan
44-
set(GRIDDLY_DEPS_DIR deps)
45-
46-
# The dependencies to load by Conan are in this file
47-
set(CONANFILE conanfile.txt)
48-
4943
option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" OFF)
5044
option(ENABLE_CACHE "Enable cache if available" ON)
5145
option(ENABLE_CLANG_TIDY "Enable static analysis with clang-tidy" OFF)
@@ -62,6 +56,7 @@ option(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR "Enable undefined behavior sanitizer"
6256
option(ENABLE_PYTHON_BINDINGS "Enable to build the bindings to other languages." ON)
6357
option(ENABLE_TESTING "Enable Test Builds" ON)
6458
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF)
59+
option(WASM "Enable Web-assembly build" OFF)
6560

6661
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR})
6762
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR})
@@ -75,13 +70,10 @@ add_library(project_warnings INTERFACE)
7570

7671
message(STATUS ${CMAKE_SYSTEM_NAME})
7772

78-
if(${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
79-
set(WASM ON)
73+
if(WASM)
8074
message(STATUS "Compiling for webassembly using emscripten")
8175
target_compile_definitions(project_options INTERFACE "-DWASM")
8276
target_compile_options(project_options INTERFACE "-fexceptions")
83-
else()
84-
set(WASM OFF)
8577
endif()
8678

8779
if(MSVC)
@@ -127,58 +119,38 @@ enable_sanitizers(project_options)
127119
include(${CMAKE_CONFIG_FOLDER}/settings/StaticAnalyzers.cmake)
128120

129121
include(${CMAKE_CONFIG_FOLDER}/settings/Conan.cmake)
130-
run_conan()
131-
include(${PROJECT_BINARY_DIR}/conanbuildinfo.cmake)
132-
include(${PROJECT_BINARY_DIR}/conan_paths.cmake)
133-
134-
# find the dependencies from conan
135-
set(PYBIND11_FINDPYTHON FALSE)
136-
137-
# set(Python_ROOT_DIR /opt/python/$ENV{PYBIN})
138-
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
139-
message(STATUS "PYTHON INFO::")
140-
message(STATUS "Python_FOUND = ${Python_FOUND}")
141-
message(STATUS "Python_ROOT_DIR = ${Python_ROOT_DIR}")
142-
message(STATUS "Python_Interpreter_FOUND = ${Python_Interpreter_FOUND}")
143-
message(STATUS "Python_EXECUTABLE = ${Python_EXECUTABLE}")
144-
message(STATUS "Python_INTERPRETER_ID = ${Python_INTERPRETER_ID}")
145-
message(STATUS "Python_STDLIB = ${Python_STDLIB}")
146-
message(STATUS "Python_STDARCH = ${Python_STDARCH}")
147-
message(STATUS "Python_SITELIB = ${Python_SITELIB}")
148-
message(STATUS "Python_SITEARCH = ${Python_SITEARCH}")
149-
message(STATUS "Python_SOABI = ${Python_SOABI}")
150-
message(STATUS "Python_Compiler_FOUND = ${Python_Compiler_FOUND}")
151-
message(STATUS "Python_COMPILER = ${Python_COMPILER}")
152-
message(STATUS "Python_COMPILER_ID = ${Python_COMPILER_ID}")
153-
message(STATUS "Python_DOTNET_LAUNCHER = ${Python_DOTNET_LAUNCHER}")
154-
message(STATUS "Python_Development_FOUND = ${Python_Development_FOUND}")
155-
message(STATUS "Python_Development.Module_FOUND = ${Python_Development.Module_FOUND}")
156-
message(STATUS "Python_Development.Embed_FOUND = ${Python_Development.Embed_FOUND}")
157-
message(STATUS "Python_INCLUDE_DIRS = ${Python_INCLUDE_DIRS}")
158-
message(STATUS "Python_LINK_OPTIONS = ${Python_LINK_OPTIONS}")
159-
message(STATUS "Python_LIBRARIES = ${Python_LIBRARIES}")
160-
message(STATUS "Python_LIBRARY_DIRS = ${Python_LIBRARY_DIRS}")
161-
message(STATUS "Python_RUNTIME_LIBRARY_DIRS = ${Python_RUNTIME_LIBRARY_DIRS}")
162-
message(STATUS "Python_VERSION = ${Python_VERSION}")
163-
164-
# pybind11
165-
find_package(pybind11 REQUIRED)
166122

167123
# glm
168124
find_package(glm REQUIRED)
169125

170126
# Yaml-Cpp
171127
find_package(yaml-cpp REQUIRED)
172128

173-
# stb
174-
find_package(stb REQUIRED)
129+
# spdlog
130+
find_package(spdlog REQUIRED)
175131

176-
# Vulkan
177-
find_package(volk REQUIRED)
132+
if(NOT WASM)
133+
# find the dependencies from conan
134+
set(PYBIND11_FINDPYTHON FALSE)
135+
136+
# set(Python_ROOT_DIR /opt/python/$ENV{PYBIN})
137+
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
138+
# pybind11
139+
find_package(pybind11 REQUIRED)
140+
141+
# GTest
142+
if(ENABLE_TESTING)
143+
find_package(GTest REQUIRED)
144+
endif()
178145

179-
# GTest
180-
if(ENABLE_TESTING)
181-
find_package(GTest REQUIRED)
146+
# stb
147+
find_package(stb REQUIRED)
148+
149+
# Vulkan
150+
find_package(volk REQUIRED)
151+
152+
# ShaderC for compiling shaders
153+
find_package(shaderc REQUIRED)
182154
endif()
183155

184156
include(${CMAKE_CONFIG_FOLDER}/targets/griddly.cmake)
@@ -190,26 +162,26 @@ else()
190162
if(NOT WASM)
191163
message(STATUS "Compiling shaders...")
192164

193-
set(ENV{GLSLC_BIN} ${CONAN_BIN_DIRS_SHADERC}/glslc)
165+
set(ENV{GLSLC_BIN} ${CONAN_SHADERC_ROOT}/bin/glslc)
194166

195167
if(MSVC)
196168
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/compile_shaders.bat RESULT_VARIABLE rv)
197169
else()
198170
execute_process(COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/compile_shaders.sh RESULT_VARIABLE rv)
199171
endif()
200-
endif()
201172

202-
if(ENABLE_PYTHON_BINDINGS)
203-
message("Configuring Python Bindings.")
204-
include(${CMAKE_CONFIG_FOLDER}/targets/python_griddly.cmake)
205-
endif()
173+
if(ENABLE_PYTHON_BINDINGS)
174+
message("Configuring Python Bindings.")
175+
include(${CMAKE_CONFIG_FOLDER}/targets/python_griddly.cmake)
176+
endif()
206177

207-
if(ENABLE_TESTING)
208-
message("Configuring Tests.")
209-
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1) # prevent CTest from flooding the target space with CI/CD targets
210-
include(CTest)
211-
enable_testing()
212-
include(${CMAKE_CONFIG_FOLDER}/targets/test.cmake)
178+
if(ENABLE_TESTING)
179+
message("Configuring Tests.")
180+
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1) # prevent CTest from flooding the target space with CI/CD targets
181+
include(CTest)
182+
enable_testing()
183+
include(${CMAKE_CONFIG_FOLDER}/targets/test.cmake)
184+
endif()
213185
endif()
214186

215187
include(CMakePackageConfigHelpers)

CMakeUserPresets.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"version": 3,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 21,
6+
"patch": 0
7+
},
8+
"configurePresets": [
9+
{
10+
"name": "Debug Native",
11+
"displayName": "Debug Native",
12+
"description": "",
13+
"generator": "Ninja",
14+
"cacheVariables": {
15+
"CMAKE_POLICY_DEFAULT_CMP0091": "NEW",
16+
"CMAKE_BUILD_TYPE": "Debug"
17+
},
18+
"toolchainFile": "/home/bam4d/qmul/Griddly/build/conan_toolchain.cmake",
19+
"binaryDir": "/home/bam4d/qmul/Griddly/build"
20+
},
21+
{
22+
"name": "Debug WASM",
23+
"displayName": "Debug WASM",
24+
"description": "",
25+
"generator": "Ninja",
26+
"cacheVariables": {
27+
"CMAKE_POLICY_DEFAULT_CMP0091": "NEW",
28+
"CMAKE_BUILD_TYPE": "Debug",
29+
"WASM": "ON"
30+
},
31+
"toolchainFile": "/home/bam4d/qmul/Griddly/build_wasm/conan_toolchain.cmake",
32+
"binaryDir": "/home/bam4d/qmul/Griddly/build_wasm"
33+
}
34+
],
35+
"buildPresets": [
36+
{
37+
"name": "Debug WASM",
38+
"configurePreset": "Debug WASM"
39+
},
40+
{
41+
"name": "Debug Native",
42+
"configurePreset": "Debug Native"
43+
}
44+
]
45+
}

README.md

Lines changed: 81 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -110,21 +110,83 @@ Build Status
110110
</div>
111111

112112

113-
# ![Installing](resources/images/gvgai/oryx/staff1.png) Building locally
113+
# ![Building Locally](resources/images/gvgai/oryx/staff1.png) Building locally
114114

115-
Firstly sync up the git submodules:
115+
Firstly you will need to configure the repo for the build.
116116

117+
You can do this using the `configure.sh` script in the root directory.
118+
119+
120+
## Web Assembly Binaries
121+
122+
Build a debug version of the web-assembly binaries.
123+
124+
125+
### Manually
126+
127+
You can run all the build commands manually
128+
129+
```bash
130+
131+
# Download the build requirements
132+
conan install deps/wasm/conanfile_wasm.txt --profile:host deps/wasm/emscripten.profile --profile:build default -s build_type=Debug --build missing -if build_wasm
133+
134+
# Configure the cmake build
135+
cmake . -B build_wasm -GNinja -DWASM=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
136+
137+
# Run the build
138+
cmake --build build_wasm --config Debug
117139
```
118-
git submodule init
119-
git submodule update
120-
```
121140

141+
### Using [Cmake Presets]()
142+
143+
We provide two presets for CMake to use to develop locally using your IDE (provided it supports CMakePresets)
144+
145+
```bash
146+
147+
# Download the build requirements
148+
./configure.sh -p=WASM -b=Debug
149+
150+
# Configure build with preset
151+
cmake --preset="Debug WASM"
152+
153+
# Build with preset
154+
cmake --build build_wasm --config Debug
122155
```
123-
cmake . -DCMAKE_BUILD_TYPE={Debug|Release}
124-
cmake --build .
156+
157+
## Native Binaries
158+
159+
### Manually
160+
161+
Build native griddly binaries:
162+
163+
```bash
164+
165+
# Download the build requirements
166+
conan install deps/conanfile.txt --profile default --profile deps/build.profile -s build_type=Debug --build missing -if build
167+
168+
# Configure the cmake build
169+
cmake . -B build -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
170+
171+
# Run the build
172+
cmake --build build --config Debug
125173
```
126174

127-
Artifacts can then be found in {Debug|Release}/bin
175+
### Using [Cmake Presets]()
176+
177+
We provide two presets for CMake to use to develop locally using your IDE (provided it supports CMakePresets)
178+
179+
```bash
180+
181+
# Download the build requirements
182+
./configure.sh -b=Debug
183+
184+
# Configure build with preset
185+
cmake --preset="Debug Native"
186+
187+
# Build with preset
188+
cmake --build build --config Debug
189+
```
128190

129191
## Tests
130192

@@ -165,19 +227,24 @@ python setup.py install
165227

166228
## Prerequisites
167229

230+
We use [Conan](https://conan.io) to install all build dependencies and libraries used to compile Griddly.
231+
232+
You will need to set up a python environment of your choice and then install conan using:
233+
234+
```
235+
pip install conan
236+
```
237+
168238
### Ubuntu
239+
169240
```
170-
wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
171-
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-bionic.list http://packages.lunarg.com/vulkan/lunarg-vulkan-bionic.list
172-
sudo apt update
173-
sudo apt install vulkan-sdk
241+
1. Install [cmake](https://cmake.org/download/)
174242
```
175243

176244
### Windows
177245

178246
1. Install [cmake](https://cmake.org/download/)
179-
2. Install MinGW (posix 8.1.0) *or* MSVC
180-
3. Install [Vulkan](https://vulkan.lunarg.com/sdk/home)
247+
2. Install [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022)
181248

182249
### MacOS
183250

@@ -193,4 +260,3 @@ xcode-select --install
193260
```
194261
brew install cmake
195262
```
196-
4. Install [Vulkan](https://vulkan.lunarg.com/sdk/home)

0 commit comments

Comments
 (0)