@@ -45,6 +45,7 @@ message(FATAL_ERROR "XDDDDDDD")
45
45
if (NOT ANDROID )
46
46
find_package (OpenGL REQUIRED OPTIONAL_COMPONENTS EGL )
47
47
else ()
48
+ # TODO: @AnastaZluk we have these in our own 3rdparty anyway!
48
49
find_path (GLES3_INCLUDE_DIR GLES3/gl31.h HINTS ${ANDROID_NDK_ROOT_PATH} REQUIRED )
49
50
if (${GLES3_INCLUDE_DIR} )
50
51
set (OpenGL_OpenGL_FOUND True )
56
57
endif ()
57
58
endif ()
58
59
if (UNIX AND NOT ANDROID )
60
+ # TODO: maybe require the `-dev` packages for both? (or ship headers ourselves?)
59
61
find_package (Wayland )
60
62
find_package (X11 REQUIRED )
61
63
set (CMAKE_THREAD_PREFER_PTHREAD 1 )
@@ -124,7 +126,7 @@ option(_NBL_COMPILE_WITH_GLTF_WRITER_ "Compile with GLTF Writer" ON)
124
126
if (NBL_BUILD_ANDROID )
125
127
set (_NBL_COMPILE_WITH_BAW_LOADER_ OFF CACHE BOOL "Off for Android purposes at the moment" FORCE ) # TODO - remove when BAW-v4 is done
126
128
set (_NBL_COMPILE_WITH_BAW_WRITER_ OFF CACHE BOOL "Off for Android purposes at the moment" FORCE ) # TODO - remove when BAW-v4 is done
127
- set (NBL_BUILD_MITSUBA_LOADER OFF CACHE BOOL "Off for Android purposes at the moment" FORCE ) # TODO - compile/linker errors
129
+ set (NBL_BUILD_MITSUBA_LOADER OFF CACHE BOOL "Android doesn't need this loader, if you want it, pay us.'" FORCE )
128
130
endif ()
129
131
130
132
nbl_get_conf_dir (NABLA_CONF_DIR_DEBUG Debug )
@@ -147,13 +149,16 @@ endif()
147
149
set (_NBL_EMBED_BUILTIN_RESOURCES_ ${NBL_EMBED_BUILTIN_RESOURCES} )
148
150
149
151
#set(_NBL_TARGET_ARCH_ARM_ ${NBL_TARGET_ARCH_ARM}) #uncomment in the future
152
+
153
+ # TODO: this is a mess and not the right way to about it
150
154
if (WAYLAND_CLIENT_FOUND AND OpenGL_EGL_FOUND )
151
155
set (_NBL_BUILD_WITH_WAYLAND 1 )
152
156
#message(FATAL_ERROR "found wayland! ${WAYLAND_CLIENT_LIBRARY}")
153
157
else ()
154
158
set (_NBL_BUILD_WITH_WAYLAND 0 )
155
159
#message(FATAL_ERROR "NOT found wayland!")
156
160
endif ()
161
+
157
162
set (__NBL_FAST_MATH ${NBL_FAST_MATH} )
158
163
set (_NBL_DEBUG 0 )
159
164
set (_NBL_RELWITHDEBINFO 0 )
@@ -165,6 +170,8 @@ set(_NBL_DEBUG 1)
165
170
set (_NBL_RELWITHDEBINFO 0 )
166
171
configure_file ("${NBL_ROOT_PATH} /include/nbl/config/BuildConfigOptions.h.in" "${NABLA_CONF_DIR_DEBUG} /BuildConfigOptions.h" )
167
172
173
+
174
+ # a little bit of globbing for headers never hurt anyone
168
175
file (GLOB_RECURSE TEMP_GLOB_RES "${NBL_ROOT_PATH} /include/*.h" )
169
176
set (NABLA_HEADERS_PUBLIC ${NABLA_HEADERS_PUBLIC} ${TEMP_GLOB_RES} )
170
177
file (GLOB_RECURSE TEMP_GLOB_RES "${NBL_ROOT_PATH} /include/*.tcc" )
@@ -175,6 +182,8 @@ file(GLOB_RECURSE NABLA_HEADERS_PRIV2 "${NBL_ROOT_PATH}/src/nbl/*.h")
175
182
# just gather all the header files and later put them into project so it's easy to search for things using IDE
176
183
set (NABLA_HEADERS "${CMAKE_CURRENT_BINARY_DIR} /include/nabla.h" ${NABLA_HEADERS_PUBLIC} ${NABLA_HEADERS_PIRV1} ${NABLA_HEADERS_PRIV2} )
177
184
185
+
186
+ #
178
187
set (NBL_CORE_SOURCES
179
188
${NBL_ROOT_PATH} /src/nbl/core/IReferenceCounted.cpp
180
189
)
@@ -234,7 +243,6 @@ set(NBL_ASSET_SOURCES
234
243
235
244
# Mesh writers
236
245
# ${NBL_ROOT_PATH}/src/nbl/asset/bawformat/CBAWMeshWriter.cpp
237
-
238
246
${NBL_ROOT_PATH} /src/nbl/asset/interchange/CPLYMeshWriter.cpp
239
247
${NBL_ROOT_PATH} /src/nbl/asset/interchange/CSTLMeshWriter.cpp
240
248
${NBL_ROOT_PATH} /src/nbl/asset/interchange/CGLTFWriter.cpp
@@ -275,10 +283,6 @@ set(NBL_VIDEO_SOURCES
275
283
# Allocators
276
284
${NBL_ROOT_PATH} /src/nbl/video/alloc/SimpleGPUBufferAllocator.cpp
277
285
${NBL_ROOT_PATH} /src/nbl/video/alloc/StreamingGPUBufferAllocator.cpp
278
-
279
- # Shaders
280
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLShader.cpp
281
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLSpecializedShader.cpp
282
286
283
287
# Utilities
284
288
${NBL_ROOT_PATH} /src/nbl/video/utilities/IDescriptorSetCache.cpp
@@ -293,31 +297,28 @@ set(NBL_VIDEO_SOURCES
293
297
${NBL_ROOT_PATH} /src/nbl/video/ILogicalDevice.cpp
294
298
${NBL_ROOT_PATH} /src/nbl/video/IGPUFence.cpp
295
299
${NBL_ROOT_PATH} /src/nbl/video/IDriverMemoryAllocation.cpp
296
- )
297
- set (NBL_SCENE_SOURCES
298
- ${NBL_ROOT_PATH} /src/nbl/scene/ITransformTree.cpp
299
- )
300
- set (NABLA_SRCS_COMMON
301
- ${NBL_CORE_SOURCES}
302
- ${NBL_SYSTEM_SOURCES}
303
- ${NBL_ASSET_SOURCES}
304
- ${NBL_VIDEO_SOURCES}
305
- ${NBL_SCENE_SOURCES}
306
- ${NBL_SYSTEM_SOURCES}
307
- ${NBL_UI_SOURCES}
308
- )
309
300
310
- if (MSVC )
311
- list (APPEND NABLA_SRCS_COMMON "${PROJECT_SOURCE_DIR} /tools/debug/VisualStudio/DynamicArrayVisualizer.natvis" )
312
- endif ()
313
-
314
- if (NBL_EMBED_BUILTIN_RESOURCES )
315
- list (APPEND NABLA_SRCS_COMMON "${CMAKE_BINARY_DIR} /src/nbl/builtin/builtinResourceData.cpp" )
316
- endif ()
317
-
318
-
319
- set (NABLA_SRCS_NORMAL
320
- # Vulkan
301
+ # OpenGL
302
+ ${NBL_ROOT_PATH} /src/nbl/video/IOpenGL_FunctionTable.cpp
303
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLPipelineCache.cpp
304
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLImage.cpp
305
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLImageView.cpp
306
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLBuffer.cpp
307
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLBufferView.cpp
308
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLSpecializedShader.cpp
309
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLSampler.cpp
310
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLCommandBuffer.cpp
311
+ ${NBL_ROOT_PATH} /src/nbl/video/SOpenGLContextLocalCache.cpp
312
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLSync.cpp
313
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLShader.cpp
314
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLRenderpassIndependentPipeline.cpp
315
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLFramebuffer.cpp
316
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGL_Connection.cpp
317
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLComputePipeline.cpp
318
+ ${NBL_ROOT_PATH} /src/nbl/video/COpenGLQueryPool.cpp
319
+ ${NBL_ROOT_PATH} /src/nbl/video/debug/COpenGLDebugCallback.cpp
320
+
321
+ # Vulkan
321
322
${NBL_ROOT_PATH} /src/nbl/video/CVulkanSwapchain.cpp
322
323
${NBL_ROOT_PATH} /src/nbl/video/CVulkanFence.cpp
323
324
${NBL_ROOT_PATH} /src/nbl/video/CVulkanImage.cpp
@@ -347,31 +348,33 @@ set(NABLA_SRCS_NORMAL
347
348
${NBL_ROOT_PATH} /src/nbl/video/CVulkanGraphicsPipeline.cpp
348
349
${NBL_ROOT_PATH} /src/nbl/video/CVulkanEvent.cpp
349
350
${NBL_ROOT_PATH} /src/nbl/video/CSurfaceVulkan.cpp
350
-
351
-
352
- #opengl
353
- ${NBL_ROOT_PATH} /src/nbl/video/IOpenGL_FunctionTable.cpp
354
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLPipelineCache.cpp
355
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLImage.cpp
356
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLImageView.cpp
357
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLBuffer.cpp
358
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLBufferView.cpp
359
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLSampler.cpp
360
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLCommandBuffer.cpp
361
- ${NBL_ROOT_PATH} /src/nbl/video/SOpenGLContextLocalCache.cpp
362
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLSync.cpp
363
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLRenderpassIndependentPipeline.cpp
364
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLFramebuffer.cpp
365
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGL_Connection.cpp
366
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLComputePipeline.cpp
367
- ${NBL_ROOT_PATH} /src/nbl/video/COpenGLQueryPool.cpp
368
- ${NBL_ROOT_PATH} /src/nbl/video/debug/COpenGLDebugCallback.cpp
369
351
370
- # CUDA
352
+ # CUDA
371
353
${NBL_ROOT_PATH} /src/nbl/video/CCUDAHandler.cpp
372
354
${NBL_ROOT_PATH} /src/nbl/video/CCUDADevice.cpp
373
355
)
374
356
357
+ set (NBL_SCENE_SOURCES
358
+ ${NBL_ROOT_PATH} /src/nbl/scene/ITransformTree.cpp
359
+ )
360
+
361
+ set (NABLA_SRCS_COMMON
362
+ ${NBL_CORE_SOURCES}
363
+ ${NBL_SYSTEM_SOURCES}
364
+ ${NBL_UI_SOURCES}
365
+ ${NBL_ASSET_SOURCES}
366
+ ${NBL_VIDEO_SOURCES}
367
+ ${NBL_SCENE_SOURCES}
368
+ )
369
+
370
+ if (MSVC )
371
+ list (APPEND NABLA_SRCS_COMMON "${PROJECT_SOURCE_DIR} /tools/debug/VisualStudio/DynamicArrayVisualizer.natvis" )
372
+ endif ()
373
+
374
+ if (NBL_EMBED_BUILTIN_RESOURCES )
375
+ list (APPEND NABLA_SRCS_COMMON "${CMAKE_BINARY_DIR} /src/nbl/builtin/builtinResourceData.cpp" )
376
+ endif ()
377
+
375
378
set (COMMON_INCLUDE_DIRS
376
379
${THIRD_PARTY_SOURCE_DIR} /convertutf # TODO: remove
377
380
${THIRD_PARTY_SOURCE_DIR} /utfcpp/source # TODO: remove
@@ -499,7 +502,6 @@ endmacro()
499
502
500
503
add_library (Nabla STATIC
501
504
${NABLA_SRCS_COMMON}
502
- ${NABLA_SRCS_NORMAL}
503
505
${NABLA_HEADERS}
504
506
$< TARGET_OBJECTS:aesGladman>
505
507
$< TARGET_OBJECTS:bzip2>
0 commit comments