llista explícita de fonts en lloc de GLOB_RECURSE

This commit is contained in:
2026-05-19 18:53:53 +02:00
parent be1a9a1d9b
commit 8af4b0c259
+68 -13
View File
@@ -16,20 +16,68 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Define el directorio de los archivos fuente # Define el directorio de los archivos fuente
set(DIR_SOURCES "${CMAKE_SOURCE_DIR}/source") set(DIR_SOURCES "${CMAKE_SOURCE_DIR}/source")
# Cargar todos los archivos fuente en DIR_SOURCES (recursivo, sin external/) # --- LISTA EXPLÍCITA DE FUENTES ---
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "${DIR_SOURCES}/*.cpp") set(APP_SOURCES
list(FILTER SOURCES EXCLUDE REGEX "${DIR_SOURCES}/external/.*") source/main.cpp
# En Emscripten no compilamos sdl3gpu_shader (SDL3 GPU no está soportado en WebGL2). # --- core/audio ---
# Define NO_SHADERS más abajo y filtra el fuente aquí. source/core/audio/audio.cpp
if(EMSCRIPTEN) source/core/audio/audio_adapter.cpp
list(REMOVE_ITEM SOURCES "${DIR_SOURCES}/core/rendering/sdl3gpu/sdl3gpu_shader.cpp")
endif()
# Verificar si se encontraron archivos fuente # --- core/input ---
if(NOT SOURCES) source/core/input/global_inputs.cpp
message(FATAL_ERROR "No se encontraron archivos fuente en ${DIR_SOURCES}.") source/core/input/input.cpp
endif() 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 # Configuración de SDL3
if(EMSCRIPTEN) if(EMSCRIPTEN)
@@ -104,7 +152,14 @@ else()
endif() endif()
# Añadir ejecutable principal # 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) if(NOT APPLE AND NOT EMSCRIPTEN AND GLSLC_EXE)
add_dependencies(${PROJECT_NAME} shaders) add_dependencies(${PROJECT_NAME} shaders)