Skip to content

Commit 55d34d0

Browse files
committed
Merge branch 'master' into fix_rotation_mat
2 parents 003c39d + f64b556 commit 55d34d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2763
-2290
lines changed

.github/workflows/build-nabla.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,3 +345,44 @@ jobs:
345345
346346
$token = '${{ secrets.CE_IMAGE_UPDATE_TOKEN }}'
347347
Invoke-UpdateImages -Token $token
348+
349+
smoke-tests:
350+
name: Nabla / Smoke (${{ matrix.os }}, ${{ matrix.vendor }}-latest, ${{ matrix.config }})
351+
needs: build-windows
352+
runs-on: windows-2022
353+
strategy:
354+
fail-fast: false
355+
matrix:
356+
config: [Release, Debug, RelWithDebInfo]
357+
os: [windows-2022]
358+
vendor: [msvc]
359+
steps:
360+
- name: Checkout smoke
361+
uses: actions/checkout@v4
362+
with:
363+
fetch-depth: 1
364+
sparse-checkout: |
365+
smoke
366+
367+
- name: Download Nabla install artifact
368+
uses: actions/download-artifact@v4
369+
with:
370+
name: run-windows-17.13.6-msvc-${{ matrix.config }}-install
371+
path: smoke
372+
373+
- name: Unpack Nabla install artifact
374+
run: |
375+
$tar = Get-ChildItem smoke -Filter *-install.tar -File | Select-Object -First 1
376+
if (-not $tar) { throw "install tar not found in smoke" }
377+
tar -xf $tar.FullName -C smoke
378+
if (-not (Test-Path "smoke/build-ct/install")) { throw "smoke/build-ct/install not found" }
379+
tree.com smoke /F
380+
381+
- name: Configure Smoke
382+
run: cmake -S smoke -B smoke/out
383+
384+
- name: Build Smoke
385+
run: cmake --build smoke/out --config ${{ matrix.config }}
386+
387+
- name: CTest Smoke
388+
run: ctest --test-dir smoke/out --force-new-ctest-process --output-on-failure --no-tests=error -C ${{ matrix.config }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# usually where people build
1717
android_build/*
1818
build*/*
19+
smoke/*build*/*
1920
# default install paths
2021
install/*
2122
# legacy temporary and output directories

3rdparty/CMakeLists.txt

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ option(GIT_EXCLUDE_IS_DIRTY "Exclude IS_DIRTY from git tracking checks, will inc
292292
add_subdirectory(git-version-tracking EXCLUDE_FROM_ALL)
293293
NBL_ADD_GIT_TRACKING_META_LIBRARY(nabla "${NBL_ROOT_PATH}")
294294
NBL_ADD_GIT_TRACKING_META_LIBRARY(dxc "${CMAKE_CURRENT_SOURCE_DIR}/dxc/dxc")
295+
nbl_install_file("${CMAKE_CURRENT_BINARY_DIR}/git-version-tracking/nabla_git_info.json")
296+
nbl_install_file("${CMAKE_CURRENT_BINARY_DIR}/git-version-tracking/dxc_git_info.json")
297+
295298
NBL_GENERATE_GIT_TRACKING_META()
296299

297300
# NGFX
@@ -522,7 +525,27 @@ add_dependencies(3rdparty ${NBL_3RDPARTY_TARGETS})
522525

523526
NBL_ADJUST_FOLDERS(3rdaprty)
524527

525-
nbl_install_dir("${CMAKE_CURRENT_SOURCE_DIR}/gtl/include")
528+
nbl_install_dir(Vulkan-Headers/include/vulkan)
529+
nbl_install_dir(Vulkan-Headers/include/vk_video)
530+
531+
nbl_install_file_spec(volk/volk.h volk)
532+
533+
nbl_install_dir(gtl/include/gtl)
534+
nbl_install_dir(glm/glm)
535+
536+
nbl_install_file_spec(${CMAKE_CURRENT_BINARY_DIR}/imath/config/ImathConfig.h imath)
537+
nbl_install_dir(imath/src/Imath)
538+
539+
nbl_install_file(blake/c/blake3.h)
540+
541+
nbl_install_file_spec(nlohmann_json/include/nlohmann/json_fwd.hpp nlohmann)
542+
nbl_install_file_spec(nlohmann_json/include/nlohmann/detail/abi_macros.hpp nlohmann/detail)
543+
544+
nbl_install_dir(boost/superproject/libs/preprocessor/include/boost)
545+
546+
nbl_install_file_spec(renderdoc/renderdoc_app.h renderdoc)
547+
548+
nbl_install_file(${CMAKE_CURRENT_BINARY_DIR}/git-version-tracking/git_info.h)
526549

527550
# parent scope exports, must be at the end of the file
528551
set(_NBL_3RDPARTY_TARGETS_

3rdparty/git-version-tracking

CMakeLists.txt

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,18 @@ set(NBL_BUILD_ANDROID OFF)
2525
include(ExternalProject)
2626
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchains/android/build.cmake)
2727

28-
project(Nabla LANGUAGES CXX C)
28+
project(Nabla
29+
VERSION 0.7.2.0
30+
HOMEPAGE_URL "https://www.devsh.eu/nabla"
31+
LANGUAGES CXX C
32+
)
2933
enable_language(C CXX ASM ASM_NASM)
3034

35+
include(GNUInstallDirs)
36+
include(CMakePackageConfigHelpers)
37+
3138
if(MSVC)
3239
enable_language(ASM_MASM)
33-
link_libraries(delayimp)
3440
endif()
3541

3642
# TODO: TO BE KILLED, keep both in one tree
@@ -154,31 +160,16 @@ if(_NBL_AVAILABLE_PHYSICAL_MEMORY_ LESS_EQUAL _NBL_DEBUG_MEMORY_CONSUPTION_WITH_
154160
else()
155161
set(_NBL_CMAKE_STATUS_ FATAL_ERROR)
156162
endif()
157-
163+
158164
message(${_NBL_CMAKE_STATUS_} "Memory consumption issue detected! To protect you from compile and linker errors, please read this message.\n\nYour total physical memory is ${_NBL_TOTAL_PHYSICAL_MEMORY_} MBs, your OS is currently using ${_NBL_CURRENTLY_USED_PHYSICAL_MEMORY_} MBs and consumption of your memory with requested ${_NBL_JOBS_AMOUNT_} jobs in Debug configuration may be around ${_NBL_DEBUG_MEMORY_CONSUPTION_WITH_ALL_JOBS_} MBs. Please override '_NBL_JOBS_AMOUNT_' variable by setting it as cache variable and lower the jobs! If you want to continue anyway, please define 'NBL_MEMORY_CONSUMPTION_CHECK_SKIP' but be aware - you are doing it on your own risk of possible build failures.")
159165
endif()
160166

161167
include(adjust/flags)
162168
include(adjust/definitions)
163169

164-
if(WIN32)
165-
set(_NBL_PLATFORM_WINDOWS_ 1)
166-
elseif(ANDROID)
167-
set(_NBL_PLATFORM_ANDROID_ 1)
168-
elseif(UNIX)
169-
set(_NBL_PLATFORM_LINUX_ 1)
170-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
171-
endif()
172-
173-
if(NBL_STATIC_BUILD)
174-
unset(_NBL_SHARED_BUILD_ CACHE)
175-
else()
176-
set(_NBL_SHARED_BUILD_ ON CACHE INTERNAL "")
177-
endif()
178-
179170
option(NBL_BUILD_DPL "Enable DPL (Dynamic Parallelism Library)" OFF)
180171
option(NBL_PCH "Enable pre-compiled header" ON)
181-
option(NBL_FAST_MATH "Enable fast low-precision math" ON)
172+
option(NBL_FAST_MATH "Enable fast low-precision math" OFF) # the reason OFF is by default now is the var controling it at build time was set AFTER BuildConfigOptions was generated - resulting in the feature being always OFF regardless the value xD - so just for sanity, keeping the same behaviour by default
182173
option(NBL_BUILD_EXAMPLES "Enable building examples" ON)
183174
option(NBL_BUILD_MITSUBA_LOADER "Enable nbl::ext::MitsubaLoader?" OFF) # TODO: once it compies turn this ON by default!
184175
option(NBL_BUILD_IMGUI "Enable nbl::ext::ImGui?" ON)
@@ -286,4 +277,43 @@ option(NBL_CPACK_INCLUDE_EXAMPLES "CPack with examples and media" ON)
286277
include(cpack/package)
287278
include(build/info)
288279
export(TARGETS ${_NBL_3RDPARTY_TARGETS_} Nabla NAMESPACE Nabla:: APPEND FILE ${NBL_ROOT_PATH_BINARY}/NablaExport.cmake)
289-
NBL_ADJUST_FOLDERS(nabla)
280+
281+
option(NBL_ENABLE_CONFIG_INSTALL "Install Relocatable NablaConfig.cmake and NablaConfigVersion.cmake scripts" ON)
282+
283+
if(NBL_ENABLE_CONFIG_INSTALL)
284+
if(NBL_STATIC_BUILD)
285+
message(WARNING "Ignoring NBL_ENABLE_CONFIG_INSTALL due to: TODO, static builds are not relocatable yet!")
286+
else()
287+
install(TARGETS Nabla
288+
EXPORT NablaExportTargets
289+
ARCHIVE DESTINATION ${_NBL_CPACK_PACKAGE_RELATIVE_ENTRY_}/lib
290+
LIBRARY DESTINATION ${_NBL_CPACK_PACKAGE_RELATIVE_ENTRY_}/lib
291+
RUNTIME DESTINATION ${_NBL_CPACK_PACKAGE_RELATIVE_ENTRY_}/runtime/nbl
292+
)
293+
294+
write_basic_package_version_file(
295+
"${CMAKE_CURRENT_BINARY_DIR}/NablaConfigVersion.cmake"
296+
VERSION ${PROJECT_VERSION}
297+
COMPATIBILITY SameMinorVersion
298+
)
299+
300+
configure_package_config_file(
301+
"${CMAKE_CURRENT_LIST_DIR}/cmake/NablaConfig.cmake.in"
302+
"${CMAKE_CURRENT_BINARY_DIR}/NablaConfig.cmake"
303+
INSTALL_DESTINATION cmake
304+
)
305+
306+
install(EXPORT NablaExportTargets
307+
NAMESPACE Nabla::
308+
DESTINATION cmake
309+
)
310+
311+
install(FILES
312+
"${CMAKE_CURRENT_BINARY_DIR}/NablaConfig.cmake"
313+
"${CMAKE_CURRENT_BINARY_DIR}/NablaConfigVersion.cmake"
314+
DESTINATION cmake
315+
)
316+
endif()
317+
endif()
318+
319+
NBL_ADJUST_FOLDERS(nabla)

cmake/FindNabla.cmake

Lines changed: 0 additions & 39 deletions
This file was deleted.

cmake/NablaConfig.cmake.in

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@PACKAGE_INIT@
2+
3+
set(Nabla_ROOT "${PACKAGE_PREFIX_DIR}")
4+
set(Nabla_GIT_INFO_JSON_FILE "${PACKAGE_PREFIX_DIR}/include/nabla_git_info.json")
5+
set(Nabla_DXC_GIT_INFO_JSON_FILE "${PACKAGE_PREFIX_DIR}/include/dxc_git_info.json")
6+
7+
if(NOT EXISTS "${Nabla_GIT_INFO_JSON_FILE}")
8+
message(FATAL_ERROR "Nabla: Git info JSON not found at \"${Nabla_GIT_INFO_JSON_FILE}\"")
9+
endif()
10+
11+
if(NOT EXISTS "${Nabla_DXC_GIT_INFO_JSON_FILE}")
12+
message(FATAL_ERROR "Nabla: DXC Git info JSON not found at \"${Nabla_DXC_GIT_INFO_JSON_FILE}\"")
13+
endif()
14+
15+
include("${CMAKE_CURRENT_LIST_DIR}/NablaExportTargets.cmake")
16+
check_required_components(Nabla)
17+
18+
if(NABLA_FIND_PACKAGE_VERBOSE)
19+
message(STATUS
20+
"\n-- Nabla_ROOT = ${Nabla_ROOT}"
21+
"\n-- Nabla_VERSION = ${Nabla_VERSION}"
22+
)
23+
24+
file(READ "${Nabla_GIT_INFO_JSON_FILE}" _nabla_git_info_raw)
25+
file(READ "${Nabla_DXC_GIT_INFO_JSON_FILE}" _nabla_dxc_git_info_raw)
26+
message(STATUS
27+
"-- Nabla module git info:"
28+
"\n${_nabla_git_info_raw}"
29+
"-- Nabla's DXC module git info:"
30+
"\n${_nabla_dxc_git_info_raw}"
31+
)
32+
endif()

0 commit comments

Comments
 (0)