Skip to content

Commit 457b48b

Browse files
committed
Update YML
1 parent a7b3bf5 commit 457b48b

File tree

2 files changed

+103
-63
lines changed

2 files changed

+103
-63
lines changed

.github/workflows/compilation.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,13 @@ jobs:
3838
uses: actions/upload-artifact@v4
3939
with:
4040
name: gsKit-samples-${{ steps.slug.outputs.sha8 }}
41-
path: build/*.elf
41+
path: |
42+
build/**/*.elf
43+
build/**/*.bmp
44+
build/**/*.jpg
45+
build/**/*.png
46+
build/**/*.tiff
47+
build/**/*.raw
48+
build/**/*.fnt
49+
build/**/*.dat
50+
build/**/*.ppm

CMakeLists.txt

Lines changed: 93 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,41 @@ if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
334334
install(FILES ${GSKIT_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}")
335335
endif()
336336

337-
if(NOT SKIP_BUILD_EXAMPLES)
337+
# All available examples
338+
set(GSKIT_SAMPLE_DIRS
339+
alpha
340+
atlas
341+
basic
342+
bigtex
343+
coverflow
344+
clut
345+
clutcsm
346+
cube
347+
fb
348+
fhdbg
349+
font
350+
fontm
351+
modetest
352+
modetesthires
353+
pixelperfect
354+
texstream
355+
textures
356+
vsync
357+
)
358+
set(GSKIT_SPECIAL_EXAMPLES hires linuz-texture png-texture)
359+
set(GSKIT_ALL_EXAMPLES ${GSKIT_SAMPLE_DIRS} ${GSKIT_SPECIAL_EXAMPLES})
360+
361+
# Option to build specific examples (empty list = skip all, default = build all)
362+
set(BUILD_EXAMPLES "${GSKIT_ALL_EXAMPLES}" CACHE STRING "List of examples to build (e.g., -DBUILD_EXAMPLES='atlas;cube'). Empty list skips all examples.")
363+
364+
if(BUILD_EXAMPLES)
365+
# Validate requested examples
366+
foreach(example IN LISTS BUILD_EXAMPLES)
367+
if(NOT example IN_LIST GSKIT_ALL_EXAMPLES)
368+
message(FATAL_ERROR "Example '${example}' not found. Available examples: ${GSKIT_ALL_EXAMPLES}")
369+
endif()
370+
endforeach()
371+
338372
set(CMAKE_EXECUTABLE_SUFFIX .elf)
339373
set(GSKIT_SAMPLE_LIBS "")
340374
list(APPEND GSKIT_SAMPLE_LIBS gskit_toolkit gskit dmakit ${GSKIT_EXTERNAL_LIBS})
@@ -349,70 +383,67 @@ if(NOT SKIP_BUILD_EXAMPLES)
349383
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/examples/${targetname}/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR} FILES_MATCHING REGEX "\\.(bmp|dat|fnt|jpg|png|ppm|raw|s|tiff)$")
350384
endmacro (add_executable_example)
351385

352-
set(GSKIT_SAMPLE_DIRS "")
353-
list(APPEND GSKIT_SAMPLE_DIRS
354-
alpha
355-
atlas
356-
basic
357-
bigtex
358-
coverflow
359-
clut
360-
clutcsm
361-
cube
362-
fb
363-
fhdbg
364-
font
365-
fontm
366-
modetest
367-
modetesthires
368-
pixelperfect
369-
texstream
370-
textures
371-
vsync
372-
)
373-
374-
foreach(arg IN ITEMS ${GSKIT_SAMPLE_DIRS})
375-
add_executable_example(${arg})
386+
# Build standard examples from the list
387+
foreach(example IN LISTS BUILD_EXAMPLES)
388+
if(example IN_LIST GSKIT_SAMPLE_DIRS)
389+
add_executable_example(${example})
390+
endif()
376391
endforeach()
377392

378-
target_link_libraries(cube
379-
draw
380-
math3d
381-
)
382-
set_property(TARGET modetest APPEND PROPERTY SOURCES examples/modetest/pad.c)
383-
target_link_libraries(modetest
384-
pad
385-
)
386-
set_property(TARGET modetesthires APPEND PROPERTY SOURCES examples/modetesthires/pad.c)
387-
target_link_libraries(modetesthires
388-
pad
389-
)
393+
# Additional configuration for specific examples
394+
if(TARGET cube)
395+
target_link_libraries(cube
396+
draw
397+
math3d
398+
)
399+
endif()
390400

391-
add_executable(hires
392-
examples/hires/main.c
393-
)
394-
target_link_libraries(hires
395-
${GSKIT_SAMPLE_LIBS}
396-
draw
397-
graph
398-
math3d
399-
packet
400-
dma
401-
)
401+
if(TARGET modetest)
402+
set_property(TARGET modetest APPEND PROPERTY SOURCES examples/modetest/pad.c)
403+
target_link_libraries(modetest
404+
pad
405+
)
406+
endif()
402407

403-
add_executable(linuz-texture
404-
examples/linuz-texture/sample.c
405-
examples/linuz-texture/testorig.s
406-
examples/linuz-texture/texture.c
407-
)
408-
target_link_libraries(linuz-texture
409-
${GSKIT_SAMPLE_LIBS}
410-
)
408+
if(TARGET modetesthires)
409+
set_property(TARGET modetesthires APPEND PROPERTY SOURCES examples/modetesthires/pad.c)
410+
target_link_libraries(modetesthires
411+
pad
412+
)
413+
endif()
411414

412-
add_executable(png-texture
413-
examples/png-texture/textures.c
414-
)
415-
target_link_libraries(png-texture
416-
${GSKIT_SAMPLE_LIBS}
417-
)
415+
# Special examples with custom source configurations
416+
if("hires" IN_LIST BUILD_EXAMPLES)
417+
add_executable(hires
418+
examples/hires/main.c
419+
)
420+
target_link_libraries(hires
421+
${GSKIT_SAMPLE_LIBS}
422+
draw
423+
graph
424+
math3d
425+
packet
426+
dma
427+
)
428+
endif()
429+
430+
if("linuz-texture" IN_LIST BUILD_EXAMPLES)
431+
add_executable(linuz-texture
432+
examples/linuz-texture/sample.c
433+
examples/linuz-texture/testorig.s
434+
examples/linuz-texture/texture.c
435+
)
436+
target_link_libraries(linuz-texture
437+
${GSKIT_SAMPLE_LIBS}
438+
)
439+
endif()
440+
441+
if("png-texture" IN_LIST BUILD_EXAMPLES)
442+
add_executable(png-texture
443+
examples/png-texture/textures.c
444+
)
445+
target_link_libraries(png-texture
446+
${GSKIT_SAMPLE_LIBS}
447+
)
448+
endif()
418449
endif()

0 commit comments

Comments
 (0)