11cmake_minimum_required (VERSION 3.18.0)
22set (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
55string (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.)
4141set (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-
4943option (BUILD_SHARED_LIBS "Enable compilation of shared libraries" OFF )
5044option (ENABLE_CACHE "Enable cache if available" ON )
5145option (ENABLE_CLANG_TIDY "Enable static analysis with clang-tidy" OFF )
@@ -62,6 +56,7 @@ option(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR "Enable undefined behavior sanitizer"
6256option (ENABLE_PYTHON_BINDINGS "Enable to build the bindings to other languages." ON )
6357option (ENABLE_TESTING "Enable Test Builds" ON )
6458option (WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF )
59+ option (WASM "Enable Web-assembly build" OFF )
6560
6661set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR} )
6762set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR} )
@@ -75,13 +70,10 @@ add_library(project_warnings INTERFACE)
7570
7671message (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 )
8577endif ()
8678
8779if (MSVC )
@@ -127,58 +119,38 @@ enable_sanitizers(project_options)
127119include (${CMAKE_CONFIG_FOLDER} /settings/StaticAnalyzers.cmake)
128120
129121include (${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
168124find_package (glm REQUIRED)
169125
170126# Yaml-Cpp
171127find_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)
182154endif ()
183155
184156include (${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)
0 commit comments