Align the Kryon package graph and retain C++ host validation
This commit is contained in:
1 parent
7b125ad80a
commit
d208dc030f
4 files changed
+25
-12
No files matched your search
@@ -39,6 +39,7 @@ by Kryon widget props. The exporter shares the parser, token resolution and
|
||||
environment rules; widget/class/state selectors become scoped DOM selectors,
|
||||
numeric units and axis properties are expanded, and media conditions survive.
|
||||
Source and saved IR run on C, C++ and Go in `tests/css_export_test.sh`.
|
||||
The C++ host compiles Ziran's generated C output as C++17.
|
||||
|
||||
The current export subset rejects unresolved imports, KSS layers, nested
|
||||
selector functions, native materials, unknown foreign blocks and output
|
||||
|
||||
@@ -17,19 +17,22 @@ for source in source saved; do
|
||||
if [ "$source" = saved ]; then input=$build/ir/css_export_behavior.zir; root=$build/ir; fi
|
||||
for target in c cpp go; do
|
||||
output=$build/$source-$target
|
||||
backend=$target
|
||||
# C++ hosts compile the supported C output; Ziran has no C++ backend.
|
||||
if [ "$target" = cpp ]; then backend=c; fi
|
||||
"$ziran" build --root "$root" --module-path src --module-path "kryon=$kryon/src/ui" \
|
||||
--module-path "$toolchain/std" --module-path "$build/ir" --no-main \
|
||||
--target="$target" --entry css_export_behavior:Answer -o "$output" "$input"
|
||||
--target="$backend" --entry css_export_behavior:Answer -o "$output" "$input"
|
||||
if [ "$target" = go ]; then
|
||||
rm -f "$output/driver.go"
|
||||
printf 'package ziran\nimport "testing"\nfunc TestCSSExport(t *testing.T) { if CssExportBehavior_Answer() != 42 { t.Fatal("CSS export") } }\n' >"$output/driver_test.go"
|
||||
(cd "$output" && GO111MODULE=off go test .)
|
||||
else
|
||||
compiler=${CC:-cc}; suffix=c; header=h; standard=c11
|
||||
if [ "$target" = cpp ]; then compiler=${CXX:-c++}; suffix=cpp; header=hpp; standard=c++17; fi
|
||||
printf '#include "css_export_behavior.%s"\nint main(void) { return Answer() == 42 ? 0 : 1; }\n' "$header" >"$output/driver.$suffix"
|
||||
"$compiler" -std="$standard" -O2 -I"$toolchain/include" -I"$output" \
|
||||
"$output"/*."$suffix" -o "$output/run"
|
||||
compiler=${CC:-cc}; language=c; standard=c11
|
||||
if [ "$target" = cpp ]; then compiler=${CXX:-c++}; language=c++; standard=c++17; fi
|
||||
printf '#include "css_export_behavior.h"\nint main(void) { return Answer() == 42 ? 0 : 1; }\n' >"$output/driver.c"
|
||||
"$compiler" -x "$language" -std="$standard" -O2 -I"$toolchain/include" -I"$output" \
|
||||
"$output"/*.c -o "$output/run"
|
||||
"$output/run"
|
||||
fi
|
||||
done
|
||||
|
||||
+14
-5
@@ -11,16 +11,25 @@
|
||||
"url": "https://github.com/raysan5/raylib.git"
|
||||
},
|
||||
{
|
||||
"commit": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68",
|
||||
"dependencies": {"raylib": "p5a77c9c35110e925"},
|
||||
"id": "pfa65f8437b3d3740",
|
||||
"commit": "1844042d1ca751e62e61df7617dba19c98588339",
|
||||
"dependencies": {},
|
||||
"id": "p651a2c7a393977c0",
|
||||
"name": "libwebp",
|
||||
"ref": "1844042d1ca751e62e61df7617dba19c98588339",
|
||||
"source": true,
|
||||
"url": "https://github.com/webmproject/libwebp.git"
|
||||
},
|
||||
{
|
||||
"commit": "7dc62902389544bf8d1fb3a159152cbd3b889c78",
|
||||
"dependencies": {"libwebp": "p651a2c7a393977c0", "raylib": "p5a77c9c35110e925"},
|
||||
"id": "pcec085fc76d6fd7b",
|
||||
"name": "kryon",
|
||||
"ref": "f6299fa1c71a6d9930df7a9a725d1a571adcbc68",
|
||||
"ref": "7dc62902389544bf8d1fb3a159152cbd3b889c78",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
}
|
||||
],
|
||||
"root": {
|
||||
"dependencies": {"kryon": "pfa65f8437b3d3740"},
|
||||
"dependencies": {"kryon": "pcec085fc76d6fd7b"},
|
||||
"name": "Kss"
|
||||
},
|
||||
"toolchain": {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ ref = "master"
|
||||
|
||||
[dependencies.kryon]
|
||||
git = "https://github.com/kryonlabs/kryon.git"
|
||||
ref = "f6299fa1c71a6d9930df7a9a725d1a571adcbc68"
|
||||
ref = "7dc62902389544bf8d1fb3a159152cbd3b889c78"
|
||||
|
||||
[exports]
|
||||
Kss = "src/Kss/module.zi"
|
||||
|
||||
Reference in new issue
Block a user