Skip to content

Commit bba93f6

Browse files
author
devsh
committed
pulled some files from wrong (bot master) branch
1 parent 593b442 commit bba93f6

File tree

3 files changed

+74
-21
lines changed

3 files changed

+74
-21
lines changed

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_

CMakeLists.txt

Lines changed: 49 additions & 19 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+
include(GNUInstallDirs)
29+
include(CMakePackageConfigHelpers)
30+
31+
project(Nabla
32+
VERSION 0.7.2.0
33+
HOMEPAGE_URL "https://www.devsh.eu/nabla"
34+
LANGUAGES CXX C
35+
)
2936
enable_language(C CXX ASM ASM_NASM)
3037

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)
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+
289319
NBL_ADJUST_FOLDERS(nabla)

CMakePresets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"version": 6,
33
"cmakeMinimumRequired": {
44
"major": 3,

0 commit comments

Comments
 (0)