Skip to content

Commit 729d31c

Browse files
committed
wipe define.h, correct headers install rules, make export install interface relocatable with generator expressions
1 parent 1bffdc7 commit 729d31c

File tree

12 files changed

+92
-382
lines changed

12 files changed

+92
-382
lines changed

CMakeLists.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ enable_language(C CXX ASM ASM_NASM)
3737

3838
if(MSVC)
3939
enable_language(ASM_MASM)
40-
link_libraries(delayimp)
4140
endif()
4241

4342
# TODO: TO BE KILLED, keep both in one tree
@@ -168,12 +167,6 @@ endif()
168167
include(adjust/flags)
169168
include(adjust/definitions)
170169

171-
if(NBL_STATIC_BUILD)
172-
unset(_NBL_SHARED_BUILD_ CACHE)
173-
else()
174-
set(_NBL_SHARED_BUILD_ ON CACHE INTERNAL "")
175-
endif()
176-
177170
option(NBL_BUILD_DPL "Enable DPL (Dynamic Parallelism Library)" OFF)
178171
option(NBL_PCH "Enable pre-compiled header" ON)
179172
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
@@ -301,18 +294,18 @@ write_basic_package_version_file(
301294
configure_package_config_file(
302295
"${CMAKE_CURRENT_LIST_DIR}/cmake/NablaConfig.cmake.in"
303296
"${CMAKE_CURRENT_BINARY_DIR}/NablaConfig.cmake"
304-
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Nabla
297+
INSTALL_DESTINATION cmake
305298
)
306299

307300
install(EXPORT NablaExportTargets
308301
NAMESPACE Nabla::
309-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Nabla
302+
DESTINATION cmake
310303
)
311304

312305
install(FILES
313306
"${CMAKE_CURRENT_BINARY_DIR}/NablaConfig.cmake"
314307
"${CMAKE_CURRENT_BINARY_DIR}/NablaConfigVersion.cmake"
315-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Nabla
308+
DESTINATION cmake
316309
)
317310

318311
NBL_ADJUST_FOLDERS(nabla)

cmake/FindNabla.cmake

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

cmake/cpack/find/compoment/template.cmake

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

cmake/cpack/find/config/template.cmake

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

cmake/cpack/find/licence/template.cmake

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

cmake/cpack/find/nabla.cmake

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

cmake/cpack/package.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,4 @@ set(CPACK_COMPONENT_HEADERS_DEPENDS Libraries Runtimes)
8787

8888
set(CPACK_THREADS 0) # try to use all threads for compression
8989

90-
include(CPack)
91-
include("${CMAKE_CURRENT_LIST_DIR}/find/nabla.cmake")
90+
include(CPack)

cmake/cpack/pipeline.groovy

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

include/nbl/config/BuildConfigOptions.h.in

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#cmakedefine _NBL_COMPILE_WITH_GLI_
1414
#cmakedefine _NBL_COMPILE_WITH_OPEN_EXR_
1515

16-
// graphics API backend
16+
// graphics API backend // TODO: never used?
1717
#cmakedefine _NBL_COMPILE_WITH_VULKAN_
1818

1919
// loaders
@@ -54,7 +54,7 @@
5454
#cmakedefine _NBL_BUILD_OPTIX_
5555

5656
// extra config
57-
#cmakedefine __NBL_FAST_MATH
57+
#cmakedefine __NBL_FAST_MATH // TODO: it should not really be there, its usage requirement
5858
#cmakedefine NBL_EMBED_BUILTIN_RESOURCES
5959

6060
#cmakedefine _NBL_BUILD_DPL_
@@ -74,8 +74,7 @@
7474
#endif
7575
#endif
7676

77-
// DLL exports
78-
#cmakedefine _NBL_SHARED_BUILD_
77+
// Nabla API definition for shared library usage, empty for static build
7978
#ifdef _NBL_SHARED_BUILD_
8079
#if defined(__NBL_BUILDING_NABLA__) // currently compiling nabla, this define is passed through the commandline
8180
#if defined(_MSC_VER)
@@ -94,15 +93,4 @@
9493
#define NBL_API2
9594
#endif
9695

97-
// any other target definitions for using Nabla as framework in another project
98-
99-
// TODO: not this way, use CMake usage requirements!
100-
/*
101-
102-
#ifndef __NBL_BUILDING_NABLA__
103-
#include "define.h"
104-
#endif // __NBL_BUILDING_NABLA__
105-
106-
*/
107-
10896
#endif // __NBL_BUILD_CONFIG_OPTIONS_H_INCLUDED__

include/nbl/system/IApplicationFramework.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,24 @@ class IApplicationFramework : public core::IReferenceCounted
6464
} install, env, build, rel;
6565

6666
#if defined(NBL_CPACK_PACKAGE_NABLA_DLL_DIR_ABS_KEY) && defined(NBL_CPACK_PACKAGE_DXC_DLL_DIR_ABS_KEY)
67+
68+
#if defined(_NABLA_INSTALL_DIR_)
6769
install.nabla = std::filesystem::absolute(system::path(_NABLA_INSTALL_DIR_) / NBL_CPACK_PACKAGE_NABLA_DLL_DIR_ABS_KEY);
6870
install.dxc = std::filesystem::absolute(system::path(_NABLA_INSTALL_DIR_) / NBL_CPACK_PACKAGE_DXC_DLL_DIR_ABS_KEY);
71+
#endif
6972

7073
env.nabla = sdk / NBL_CPACK_PACKAGE_NABLA_DLL_DIR_ABS_KEY;
7174
env.dxc = sdk / NBL_CPACK_PACKAGE_DXC_DLL_DIR_ABS_KEY;
7275
#endif
7376

7477
#ifdef _NBL_SHARED_BUILD_
78+
#if defined(_NABLA_OUTPUT_DIR_)
7579
build.nabla = _NABLA_OUTPUT_DIR_;
7680
#endif
81+
#endif
82+
#if defined(_DXC_DLL_)
7783
build.dxc = path(_DXC_DLL_).parent_path();
84+
#endif
7885

7986
#ifdef NBL_CPACK_PACKAGE_NABLA_DLL_DIR
8087
rel.nabla = NBL_CPACK_PACKAGE_NABLA_DLL_DIR;

0 commit comments

Comments
 (0)