From 8af4b0c259eb42e92b452f11a41c515e54de32ba Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Tue, 19 May 2026 18:53:53 +0200 Subject: [PATCH] =?UTF-8?q?llista=20expl=C3=ADcita=20de=20fonts=20en=20llo?= =?UTF-8?q?c=20de=20GLOB=5FRECURSE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 81 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 68 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c47fed..82173c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,20 +16,68 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Define el directorio de los archivos fuente set(DIR_SOURCES "${CMAKE_SOURCE_DIR}/source") -# Cargar todos los archivos fuente en DIR_SOURCES (recursivo, sin external/) -file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "${DIR_SOURCES}/*.cpp") -list(FILTER SOURCES EXCLUDE REGEX "${DIR_SOURCES}/external/.*") +# --- LISTA EXPLÍCITA DE FUENTES --- +set(APP_SOURCES + source/main.cpp -# En Emscripten no compilamos sdl3gpu_shader (SDL3 GPU no está soportado en WebGL2). -# Define NO_SHADERS más abajo y filtra el fuente aquí. -if(EMSCRIPTEN) - list(REMOVE_ITEM SOURCES "${DIR_SOURCES}/core/rendering/sdl3gpu/sdl3gpu_shader.cpp") -endif() + # --- core/audio --- + source/core/audio/audio.cpp + source/core/audio/audio_adapter.cpp -# Verificar si se encontraron archivos fuente -if(NOT SOURCES) - message(FATAL_ERROR "No se encontraron archivos fuente en ${DIR_SOURCES}.") -endif() + # --- core/input --- + source/core/input/global_inputs.cpp + source/core/input/input.cpp + source/core/input/mouse.cpp + + # --- core/locale --- + source/core/locale/lang.cpp + + # --- core/rendering --- + source/core/rendering/animatedsprite.cpp + source/core/rendering/fade.cpp + source/core/rendering/movingsprite.cpp + source/core/rendering/notifications.cpp + source/core/rendering/screen.cpp + source/core/rendering/sdl3gpu/sdl3gpu_shader.cpp + source/core/rendering/smartsprite.cpp + source/core/rendering/sprite.cpp + source/core/rendering/text.cpp + source/core/rendering/texture.cpp + source/core/rendering/writer.cpp + + # --- core/resources --- + source/core/resources/asset.cpp + source/core/resources/resource.cpp + source/core/resources/resource_helper.cpp + source/core/resources/resource_loader.cpp + source/core/resources/resource_pack.cpp + + # --- core/system --- + source/core/system/delta_time.cpp + source/core/system/director.cpp + + # --- game --- + source/game/game.cpp + source/game/options.cpp + + # --- game/entities --- + source/game/entities/balloon.cpp + source/game/entities/bullet.cpp + source/game/entities/item.cpp + source/game/entities/player.cpp + + # --- game/scenes --- + source/game/scenes/instructions.cpp + source/game/scenes/intro.cpp + source/game/scenes/logo.cpp + source/game/scenes/title.cpp + + # --- game/ui --- + source/game/ui/menu.cpp + + # --- utils --- + source/utils/utils.cpp +) # Configuración de SDL3 if(EMSCRIPTEN) @@ -104,7 +152,14 @@ else() endif() # Añadir ejecutable principal -add_executable(${PROJECT_NAME} ${SOURCES}) +if(EMSCRIPTEN) + # En Emscripten no compilem sdl3gpu_shader (SDL3 GPU no està suportat en WebGL2) + set(APP_SOURCES_WASM ${APP_SOURCES}) + list(REMOVE_ITEM APP_SOURCES_WASM source/core/rendering/sdl3gpu/sdl3gpu_shader.cpp) + add_executable(${PROJECT_NAME} ${APP_SOURCES_WASM}) +else() + add_executable(${PROJECT_NAME} ${APP_SOURCES}) +endif() if(NOT APPLE AND NOT EMSCRIPTEN AND GLSLC_EXE) add_dependencies(${PROJECT_NAME} shaders)