15981
|
1 |
#!/usr/bin/env sh
|
|
2 |
|
|
3 |
ls ../rc || exit
|
|
4 |
|
|
5 |
rm -rdfv build engine
|
|
6 |
mkdir -p build engine
|
|
7 |
cd build
|
|
8 |
cmake -DNOSERVER=on -DBUILD_ENGINE_C=on -DLUA_SYSTEM=on -DNOVIDEOREC=off ../../../
|
|
9 |
cmake --build . --target engine_c
|
|
10 |
|
|
11 |
# this one you can get from pip: pip install scan-build
|
|
12 |
intercept-build cmake --build . --target hwengine
|
|
13 |
c2rust transpile --emit-build-files --emit-modules --reduce-type-annotations --binary hwengine compile_commands.json --output-dir=../engine
|
|
14 |
|
|
15 |
cd ../engine
|
|
16 |
sed -i 's/f128.*//g' Cargo.toml
|
|
17 |
sed -i 's/extern crate f128.*//g' lib.rs
|
|
18 |
sed -i 's/mod src {/mod src{\npub mod to_f64;/g' lib.rs
|
|
19 |
find -type f -name '*.rs' -exec sed -i 's/f128/f64/g' {} \; -exec sed -i 's/f64::f64/f64/g' {} \; -exec sed -i 's/use ::f64;/use crate::src::to_f64::to_f64;/g' {} \; -exec sed -i 's/f64::new/to_f64/g' {} \;
|
|
20 |
cp ../to_f64.rs src/
|