Skip to content

Commit 59b9295

Browse files
committed
Move hello app inside its own folder
* As a consequence of this, the build.zig now could not import the common 'mos_build.zig' file as will complain about including a non-project file. The quick solution is to just provide a symbolic link for this 'external file', this works but its not the most idiomatic or cross platform.
1 parent 28e89a5 commit 59b9295

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

src/apps/zapps/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
find_package(Zig 0.15.1 EXACT REQUIRED)
22

33
set(ZIG_COMMON_SOURCE_FILES
4-
${CMAKE_CURRENT_LIST_DIR}/build.zig
54
${CMAKE_CURRENT_LIST_DIR}/mos_build.zig
65
)
76

87
add_zig_build(
98
NAME hello
109
SOURCES
1110
${ZIG_COMMON_SOURCE_FILES}
12-
${CMAKE_CURRENT_LIST_DIR}/hello.zig
11+
${CMAKE_CURRENT_LIST_DIR}/hello/main.zig
12+
${CMAKE_CURRENT_LIST_DIR}/hello/build.zig
1313
DEPENDS
1414
cm
1515
crta
1616
FLAGS ${MOS_ZIG_BUILD_OPTIONS}
1717
DEFINITIONS ${MOS_ZIG_BUILD_REQUIRED_DEFINES}
18-
OUTPUT ${CMAKE_CURRENT_LIST_DIR}/zig-out/bin/hello COPY_TO ${MOS_OBJ_DIR}
19-
OUTPUT ${CMAKE_CURRENT_LIST_DIR}/zig-out/bin/hello.flt COPY_TO ${MOS_BIN_DIR}
18+
OUTPUT ${CMAKE_CURRENT_LIST_DIR}/hello/zig-out/bin/hello COPY_TO ${MOS_OBJ_DIR}
19+
OUTPUT ${CMAKE_CURRENT_LIST_DIR}/hello/zig-out/bin/hello.flt COPY_TO ${MOS_BIN_DIR}
20+
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/hello
2021
)
2122

2223
add_dependencies(build-all hello)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub fn build(b: *std.Build) !void {
55
const optimize = b.standardOptimizeOption(.{});
66
const exe = mos.addExecutable(b, "hello", .{
77
.optimize = optimize,
8-
.root_src_file = "./hello.zig",
8+
.root_src_file = "./main.zig",
99
.options = try mos.addDefaultOptions(b),
1010
.target = b.resolveTargetQuery(mos.i686_target_query),
1111
});

src/apps/zapps/hello/mos_build.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../mos_build.zig

src/cm/graphics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void graphics_image_ppm (const GraphicsContext* g, UINT x, UINT y, UINT w, UINT
8989

9090
void graphics_putpixel (const GraphicsContext* g, UINT x, UINT y, Color color)
9191
{
92-
CM_DBG_FUNC_ENTRY ("area: %px, x: %u, y: %u, color: %x", g, x, y, color);
92+
//CM_DBG_FUNC_ENTRY ("area: %px, x: %u, y: %u, color: %x", g, x, y, color);
9393

9494
GxColor* start = (GxColor*)(g->buffer + (y * g->bytesPerRow) + (x * g->bytesPerPixel));
9595
GxColor* col = (GxColor*)&color;

0 commit comments

Comments
 (0)