Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdl3 build fails to find EGL/egl.h due to incorrect include path #12280

Open
theleopeople opened this issue Feb 12, 2025 · 0 comments
Open

sdl3 build fails to find EGL/egl.h due to incorrect include path #12280

theleopeople opened this issue Feb 12, 2025 · 0 comments
Assignees
Milestone

Comments

@theleopeople
Copy link

hi guys, i fixed a bug: after generating the makefile and building with make the process would stop with this error:
fatal error: EGL/egl.h: No such file or directory
i noticed that the compiler was looking in the wrong path too (instead of src/video/khronos, include/SDL/SDL_egl.h
the same build works for me with SDL2.

how i fixed.
i added "include_directories(${CMAKE_SOURCE_DIR}/dependencies/SDL3/src/video/khronos)" before this paragraph in CMakeLists.txt:

Note: The clang toolset for Visual Studio does not support the '-idirafter' option.

if(USE_GCC OR USE_INTELCC OR (USE_CLANG AND NOT MSVC_CLANG))
sdl_compile_options(NO_EXPORT PRIVATE "$<BUILD_INTERFACE:-idirafter${SDL3_SOURCE_DIR}/src/video/khronos>")
else()
sdl_include_directories(NO_EXPORT SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL3_SOURCE_DIR}/src/video/khronos>")
endif()

that obv works for me but you may fix this as it's best suitable for you.

SDL2 CMakeLists.txt same paragraph that worked for me was like this:

Note: The clang toolset for Visual Studio does not support the '-idirafter' option.

if(USE_GCC OR (USE_CLANG AND NOT MSVC_CLANG))

!!! FIXME: do we need to mess with CMAKE_C_FLAGS here?

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -idirafter "${SDL2_SOURCE_DIR}/src/video/khronos"")
else()
target_include_directories(sdl-build-options INTERFACE "${SDL2_SOURCE_DIR}/src/video/khronos")
endif()

@slouken slouken added this to the 3.x milestone Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants