From 00f2db648f596ed30ced569f994d766fff6d6c22 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Tue, 27 May 2025 14:15:54 +0530 Subject: [PATCH] Fix SDL2 header access issue --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e64f798..a36d5066 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -431,6 +431,14 @@ if (XEUS_CPP_BUILD_EXECUTABLE) endif() if(EMSCRIPTEN) + # Ensure required SDL2 ports (e.g. SDL2) are built before header preloading + execute_process( + COMMAND embuilder build sdl2 + RESULT_VARIABLE SDL2_RESULT + ) + if(NOT SDL2_RESULT EQUAL 0) + message(FATAL_ERROR "Failed to run 'embuilder build sdl2'") + endif() include(WasmBuildOptions) find_package(xeus-lite REQUIRED) add_executable(xcpp src/main_emscripten_kernel.cpp )