Changes
8 changed files (+187/-1)
-
cli/README.md (new)
-
@@ -0,0 +1,22 @@<!-- Copyright 2025 Shota FUJI Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache-2.0 --> # CLI CLI is for designing core and GUI elements. This is not intended for real-world uses.
-
-
cli/build.zig (new)
-
@@ -0,0 +1,53 @@// Copyright 2025 Shota FUJI // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 //! This file defines how `zig build` command behaves. //! Run `zig build --help` for available subcommands and options. //! //! Learn more at //! https://ziglang.org/learn/build-system/ const std = @import("std"); pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); const core = core: { const dep = b.dependency("plac_core", .{ .target = target, .optimize = optimize, }); break :core dep.module("core"); }; // Executable { const exe = b.addExecutable(.{ .name = "plac", .root_module = b.createModule(.{ .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }), }); exe.root_module.addImport("core", core); b.installArtifact(exe); } }
-
-
cli/build.zig.zon (new)
-
@@ -0,0 +1,31 @@// Copyright 2025 Shota FUJI // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 .{ .name = .plac_cli, .version = "0.0.0", .fingerprint = 0xbc872ed057582c78, .minimum_zig_version = "0.14.0", .dependencies = .{ .plac_core = .{ .path = "../core", }, }, .paths = .{ "build.zig", "build.zig.zon", "src/", }, }
-
-
cli/src/main.zig (new)
-
@@ -0,0 +1,22 @@// Copyright 2025 Shota FUJI // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 const std = @import("std"); const core = @import("core"); pub fn main() void { std.debug.print("Hello, {}!\n", .{core.adder(1, 2)}); }
-
-
-
@@ -26,6 +26,13 @@ pub fn build(b: *std.Build) void {const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); // Zig module { _ = b.addModule("core", .{ .root_source_file = b.path("src/mod.zig"), }); } // Static library (C API) { const linkage = b.option(
-
-
core/build.zig.zon (new)
-
@@ -0,0 +1,27 @@// Copyright 2025 Shota FUJI // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 .{ .name = .plac_core, .version = "0.0.0", .fingerprint = 0xc2c55a63ff4f6fb3, .minimum_zig_version = "0.14.0", .dependencies = .{}, .paths = .{ "build.zig", "build.zig.zon", "src/", }, }
-
-
-
@@ -16,7 +16,9 @@ // SPDX-License-Identifier: Apache-2.0//! This is an entrypoint of the static library. const mod = @import("./mod.zig"); // TODO: Remove after implementing actual exports. export fn adder(a: c_int, b: c_int) c_int { return a + b; return mod.adder(a, b); }
-
-
core/src/mod.zig (new)
-
@@ -0,0 +1,22 @@// Copyright 2025 Shota FUJI // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 //! This is an entrypoint of Zig module. // TODO: Remove after implementing actual exports. pub fn adder(a: i32, b: i32) i32 { return a + b; }
-