Repository navigation
Expand file tree
/
Copy pathmcpp.toml
More file actions
133 lines (106 loc) · 5.66 KB
/
Copy pathmcpp.toml
File metadata and controls
133 lines (106 loc) · 5.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
[package]
namespace = "mcpplibs"
name = "os"
version = "0.4.9"
description = "mcpplibs.os: a C++ operating-system library over openkal --- processes, files, environment, terminals, directories and local IPC, with compile-time platform constants and a few platform modules."
license = "Apache-2.0"
authors = ["mcpplibs"]
repo = "https://github.com/mcpplibs/os"
# The kernel layer is openkal and only openkal (design 2026-10-26 part 2, D3):
# one implementation per target, in the arrangement that borrows the program's
# own C and C++ runtime. A program that wants the standalone arrangement, or
# the image arrangement of `<arch>-openkal`, selects it in its own manifest.
[dependencies]
openkal = ">=0.24.0, <0.27.0"
[target.linux.dependencies]
openkal-linux = ">=0.25.0, <0.28.0"
[target.macos.dependencies]
openkal-macos = ">=0.22.0, <0.25.0"
[target.windows.dependencies]
openkal-windows = ">=0.20.0, <0.24.0"
# Emscripten (`wasm32-emscripten`): openkal written above the C library, with
# twelve of openkal's fifteen interfaces. `openkal.process', `openkal.exec' and
# `openkal.space' are absent, so a program that starts one fails at link
# naming the symbol; `openkal.task' is present in a `-pthread' link only.
[target.'cfg(os = "emscripten")'.dependencies]
openkal-emscripten = ">=0.13.0, <0.16.0"
[targets.os]
kind = "lib"
# The interface units and the implementations built on openkal are the same on
# every target. What differs is the compile-time constant of the target, the
# services an environment offers outside the kernel (`machine`), and the
# platform modules, which are declared everywhere and defined only on their own
# platform (R5): a misuse is a link error, never a branch at run time.
[build]
sources = ["src/*.cppm", "src/*.cpp"]
# A request to end, over openkal's stop word and its wait: on every target that
# has `openkal.process' and `openkal.task'. Emscripten has neither, and its
# interrupt is src/emscripten/interrupt.cpp.
[target.'cfg(not(os = "emscripten"))'.build]
sources = ["src/kal/interrupt.cpp"]
# Where the user is (`locale'): the environment and the zoneinfo files on every
# target but Windows, which answers from kernel32 (src/windows/locale.cpp).
[target.'cfg(not(windows))'.build]
sources = ["src/locale/system.cpp"]
# The architecture of the build, as a constant beside the platform's.
[target.'cfg(arch = "x86_64")'.build]
sources = ["src/arch/x86_64.cppm"]
[target.'cfg(arch = "aarch64")'.build]
sources = ["src/arch/aarch64.cppm"]
[target.'cfg(arch = "riscv64")'.build]
sources = ["src/arch/riscv64.cppm"]
[target.'cfg(arch = "wasm32")'.build]
sources = ["src/arch/wasm32.cppm"]
[target.linux.build]
sources = ["src/targets/linux.cppm", "src/linux/*.cpp", "src/posix/*.cpp"]
# The kernel's calls (src/linux/kernel.h): the trap of each architecture.
[target.'cfg(all(linux, arch = "x86_64"))'.build]
sources = ["src/linux/arch/x86_64.cpp"]
[target.'cfg(all(linux, arch = "aarch64"))'.build]
sources = ["src/linux/arch/aarch64.cpp"]
[target.'cfg(all(linux, arch = "riscv64"))'.build]
sources = ["src/linux/arch/riscv64.cpp"]
[target.macos.build]
sources = ["src/targets/macos.cppm", "src/macos/*.cpp", "src/posix/*.cpp"]
# libSystem's names the macOS units call (src/macos/darwin.h), allowed to be
# absent from a link whose libSystem is openkal-macos's stub: the loader finds
# them in libSystem. A link against the SDK binds them as usual.
ldflags = ["-Wl,-U,_sysctlbyname", "-Wl,-U,_mach_host_self", "-Wl,-U,_host_page_size",
"-Wl,-U,_host_statistics64"]
[target.'cfg(all(macos, arch = "x86_64"))'.build]
sources = ["src/macos/arch/x86_64.cpp"]
[target.'cfg(all(macos, arch = "aarch64"))'.build]
sources = ["src/macos/arch/aarch64.cpp"]
[target.windows.build]
sources = ["src/targets/windows.cppm", "src/windows/*.cpp"]
# The standard output is diverted where the C library keeps it: the Microsoft
# C runtime's descriptors, which set the process's standard handles too; or,
# for a C library on openkal (openkal-musl), that library's descriptors and the
# process's standard handles, each kept apart.
[target.'cfg(all(windows, not(c-abi = "musl")))'.build]
sources = ["src/windows/crt/stdio.cpp"]
[target.'cfg(all(windows, c-abi = "musl"))'.build]
sources = ["src/windows/posix/stdio.cpp"]
# EMSCRIPTEN: a wasm module over Emscripten's C library, under node or in a
# page. No platform module is defined; the file system's durability and
# ownership are the C library's (src/posix/fs.cpp), and the rest is
# src/emscripten/.
[target.'cfg(os = "emscripten")'.build]
sources = ["src/targets/emscripten.cppm", "src/emscripten/*.cpp", "src/posix/fs.cpp", "src/watch/none.cpp"]
# AN OK IMAGE (`<arch>-openkal', openkal SPEC clause 12): no implementation
# beneath --- the loader binds the image's `kal_*' --- and the platform modules
# defined where an image can answer them (R5 as revised in 0.4.0): Linux's
# translator from /proc, Windows' token and developer volume and the POSIX
# effective user from the system's own programs, macOS' translation as never.
# `host()' and the conventions are answered when the image is loaded.
[target.'cfg(os = "openkal")'.build]
sources = ["src/targets/openkal.cppm", "src/openkal/*.cpp", "src/linux/linux.cpp", "src/watch/none.cpp"]
# The C library, the C++ run-time and the loader of an image are its
# platform's: mcpp 2026.10.27.1 and later select openkal-platform for
# `<arch>-openkal` (mcpp SPEC-013), so this package declares none of them.
# The tests are mtest's: each file of tests/ declares an object and no `main'.
# mtest uses this package, and its tests build it against the os under test
# (mcpp 2026.11.9.1: the package being built stands for itself in its tests'
# graph).
[dev-dependencies]
mcpplibs.mtest = "0.5.2"