Skip to content

Commit 21a88ff

Browse files
author
devsh
committed
aaah the BuiltinResourcesApplication.hpp header needs some special treatment to NOT include this_example/CArchive
1 parent 20a5438 commit 21a88ff

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

common/include/nbl/examples/PCH.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
#include "nabla.h"
1515

1616
//! Common example interface headers
17-
18-
#include "nbl/examples/common/BuiltinResourcesApplication.hpp"
1917
#include "nbl/examples/common/SimpleWindowedApplication.hpp"
2018
#include "nbl/examples/common/MonoWindowApplication.hpp"
2119
#include "nbl/examples/common/InputSystem.hpp"

common/include/nbl/examples/common/BuiltinResourcesApplication.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// TODO: the include/header `nbl/examples` archive
1313
// TODO: the source `nbl/examples` archive
1414
// TODO: the build `nbl/examples` archive
15+
// TODO: make the `this_example` optional, only if the example has builtins
1516
#include "nbl/this_example/builtin/CArchive.h"
1617
#endif
1718

@@ -41,7 +42,9 @@ class BuiltinResourcesApplication : public virtual application_templates::MonoAs
4142
smart_refctd_ptr<system::IFileArchive> examplesHeaderArch,examplesSourceArch,examplesBuildArch,thisExampleArch;
4243
#ifdef NBL_EMBED_BUILTIN_RESOURCES
4344
// TODO: the 3 examples archives
44-
thisExampleArch = make_smart_refctd_ptr<nbl::this_example::builtin::CArchive>(smart_refctd_ptr(m_logger));
45+
#ifdef _NBL_THIS_EXAMPLE_BUILTIN_C_ARCHIVE_H_
46+
thisExampleArch = make_smart_refctd_ptr<nbl::this_example::builtin::CArchive>(smart_refctd_ptr(m_logger));
47+
#endif
4548
#else
4649
examplesHeaderArch = make_smart_refctd_ptr<system::CMountDirectoryArchive>(localInputCWD/"../common/include/nbl/examples",smart_refctd_ptr(m_logger),m_system.get());
4750
examplesSourceArch = make_smart_refctd_ptr<system::CMountDirectoryArchive>(localInputCWD/"../common/src/nbl/examples",smart_refctd_ptr(m_logger),m_system.get());

common/include/nbl/examples/examples.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#ifndef _NBL_EXAMPLES_HPP_
55
#define _NBL_EXAMPLES_HPP_
66

7+
78
//! Precompiled header shared across all examples
89
#include "nbl/examples/PCH.hpp"
910

@@ -16,4 +17,8 @@
1617

1718
// #include "..."
1819

20+
// Cannot be in PCH because depens on definition of `this_example` for Example's builtins
21+
#include "nbl/examples/common/BuiltinResourcesApplication.hpp"
22+
23+
1924
#endif // _NBL_EXAMPLES_HPP_

0 commit comments

Comments
 (0)