Skip to content

Commit f770ef0

Browse files
committed
add EGL fix for sample targets, linker error left
1 parent 901effb commit f770ef0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cmake/common.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ macro(nbl_create_executable_project _EXTRA_SOURCES _EXTRA_OPTIONS _EXTRA_INCLUDE
4747

4848
# EXTRA_SOURCES is var containing non-common names of sources (if any such sources, then EXTRA_SOURCES must be set before including this cmake code)
4949
add_dependencies(${EXECUTABLE_NAME} Nabla)
50-
50+
get_target_property(NBL_EGL_INCLUDE_DIRECORIES egl INCLUDE_DIRECTORIES)
51+
5152
target_include_directories(${EXECUTABLE_NAME}
5253
PUBLIC ../../include
5354
PRIVATE ${_EXTRA_INCLUDES}
55+
PRIVATE ${NBL_EGL_INCLUDE_DIRECORIES}
5456
)
55-
target_link_libraries(${EXECUTABLE_NAME} Nabla ${_EXTRA_LIBS}) # see, this is how you should code to resolve github issue 311
57+
target_link_libraries(${EXECUTABLE_NAME} PUBLIC Nabla ${_EXTRA_LIBS}) # see, this is how you should code to resolve github issue 311
5658

5759
add_compile_options(${_EXTRA_OPTIONS})
5860

src/nbl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ target_include_directories(Nabla PUBLIC
582582
"$<$<BOOL:${OpenGL_EGL_FOUND}>:${OPENGL_EGL_INCLUDE_DIRS}>"
583583
"$<$<BOOL:${WAYLAND_CLIENT_FOUND}>:${WAYLAND_CLIENT_INCLUDE_DIR}>"
584584
)
585+
585586
target_include_directories(Nabla PUBLIC ${NBL_ROOT_PATH}/src ${NBL_ROOT_PATH}/source/Nabla ${NBL_ROOT_PATH}/src/3rdparty) # this should be PRIVATE, but things from /src (or /source) are sometimes included in things in /include and so examples have to put source dirs into theirs Include Path
586587
target_include_directories(Nabla PRIVATE ${CMAKE_BINARY_DIR}/include)
587588
if (UNIX AND NOT ANDROID AND NOT APPLE)

0 commit comments

Comments
 (0)