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
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)