Skip to content

Commit e2dd1e1

Browse files
author
amalxloop
committed
Fix CI failures: missing SC_ERR_GFX, -march=native on WASM, -x c placement
- Add SC_ERR_GFX alias for SC_ERR_BACKEND (was undefined, breaking Vulkan compile) - Guard -march=native with if(NOT WASM) (unsupported on wasm32-unknown-emscripten) - Wrap stock_dashboard target in if(NOT WASM) (native Linux executable) - Move -x c before input file in Vulkan CI compile step
1 parent ad5a7b0 commit e2dd1e1

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
-DSC_GFX_BACKEND_VULKAN -DSC_BACKEND_VULKAN_IMPLEMENTATION \
3737
-DSC_LAYOUT_IMPLEMENTATION -DSC_WIDGET_IMPLEMENTATION \
3838
-DSC_RUNTIME_IMPLEMENTATION -DSC_FONT_IMPLEMENTATION \
39-
-c backends/sc_backend_vulkan.h -o /dev/null -x c \
39+
-x c -c backends/sc_backend_vulkan.h -o /dev/null \
4040
-Wall -Wextra -Wpedantic -Wshadow
4141
- name: Build and run Vulkan headless test
4242
run: |

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ add_compile_options(
6363
-Wall -Wextra -Wpedantic
6464
-Wno-unused-parameter
6565
$<$<CONFIG:Release>:-O3>
66-
$<$<CONFIG:Release>:-march=native>
6766
$<$<CONFIG:Release>:-ffast-math>
6867
$<$<CONFIG:Debug>:-O0>
6968
$<$<CONFIG:Debug>:-g3>
7069
$<$<CONFIG:Debug>:-fno-omit-frame-pointer>
7170
)
71+
if(NOT WASM)
72+
add_compile_options($<$<CONFIG:Release>:-march=native>)
73+
endif()
7274

7375
if(SC_ASAN)
7476
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
@@ -139,6 +141,7 @@ endif()
139141
# ---------------------------------------------------------------------------
140142
# Stock Dashboard PoC executable
141143
# ---------------------------------------------------------------------------
144+
if(NOT WASM)
142145
add_executable(stock_dashboard
143146
${CMAKE_SOURCE_DIR}/apps/stock_dashboard/stock_dashboard.c
144147
)
@@ -148,6 +151,7 @@ target_link_libraries(stock_dashboard PRIVATE m ${SC_GFX_LIBS})
148151
target_compile_options(stock_dashboard PRIVATE
149152
$<$<CONFIG:Release>:-O3 -march=native -ffast-math>
150153
)
154+
endif()
151155

152156
# ---------------------------------------------------------------------------
153157
# Test suite
@@ -174,7 +178,9 @@ endif()
174178
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include/silvercore
175179
FILES_MATCHING PATTERN "*.h"
176180
)
177-
install(TARGETS stock_dashboard RUNTIME DESTINATION bin)
181+
if(TARGET stock_dashboard)
182+
install(TARGETS stock_dashboard RUNTIME DESTINATION bin)
183+
endif()
178184

179185
# ---------------------------------------------------------------------------
180186
# Summary

include/sc_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ typedef enum SCResult {
143143
SC_ERR_NOT_FOUND = -4,
144144
SC_ERR_NOT_SUPPORTED = -5,
145145
SC_ERR_BACKEND = -6, /* graphics backend error */
146+
SC_ERR_GFX = SC_ERR_BACKEND, /* alias for SC_ERR_BACKEND */
146147
SC_ERR_IO = -7,
147148
SC_ERR_OVERFLOW = -8,
148149
SC_ERR_TIMEOUT = -9,

0 commit comments

Comments
 (0)