mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-23 13:00:17 +00:00
...
This commit is contained in:
parent
48da917caf
commit
e6c5ace927
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
@ -61,8 +61,11 @@ jobs:
|
|||||||
path: output
|
path: output
|
||||||
- name: Benchmark
|
- name: Benchmark
|
||||||
run: python3 scripts/run_tests.py benchmark
|
run: python3 scripts/run_tests.py benchmark
|
||||||
# - name: GCC Build Test
|
- name: GCC Build Test
|
||||||
# run: g++ -o pocketpy --std=c++17 src/main.cpp
|
run: |
|
||||||
|
SRC=$(find src/ -name "*.cpp")
|
||||||
|
g++ -o main --std=c++17 src/main.cpp $SRC
|
||||||
|
python3 scripts/run_tests.py
|
||||||
- name: C Binding Test
|
- name: C Binding Test
|
||||||
run: bash run_c_binding_test.sh
|
run: bash run_c_binding_test.sh
|
||||||
build_macos:
|
build_macos:
|
||||||
|
@ -43,10 +43,6 @@ To compile it with your project, these flags must be set:
|
|||||||
+ RTTI is not required
|
+ RTTI is not required
|
||||||
+ If clang is used, `-stdlib=libc++` must be set
|
+ If clang is used, `-stdlib=libc++` must be set
|
||||||
|
|
||||||
!!!
|
|
||||||
For maximum performance, we recommend to use `clang++` with `-O2` flag.
|
|
||||||
!!!
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
|
@ -81,10 +81,10 @@ with open("amalgamated/main.cpp", "wt", encoding='utf-8') as f:
|
|||||||
f.write(text)
|
f.write(text)
|
||||||
|
|
||||||
if sys.platform in ['linux', 'darwin']:
|
if sys.platform in ['linux', 'darwin']:
|
||||||
ok = os.system("clang++ -o pocketpy amalgamated/main.cpp --std=c++17 -stdlib=libc++ -ldl")
|
ok = os.system("clang++ -o main amalgamated/main.cpp --std=c++17 -stdlib=libc++ -ldl")
|
||||||
if ok == 0:
|
if ok == 0:
|
||||||
print("Test build success!")
|
print("Test build success!")
|
||||||
os.remove("pocketpy")
|
os.remove("main")
|
||||||
|
|
||||||
print("amalgamated/pocketpy.h")
|
print("amalgamated/pocketpy.h")
|
||||||
|
|
||||||
|
2
build.sh
2
build.sh
@ -1,3 +1,3 @@
|
|||||||
python3 prebuild.py
|
python3 prebuild.py
|
||||||
SRC=$(find src/ -name "*.cpp")
|
SRC=$(find src/ -name "*.cpp")
|
||||||
clang++ -std=c++17 -fno-rtti -O2 -stdlib=libc++ -Wfatal-errors -o pocketpy src2/main.cpp $SRC -Iinclude -ldl
|
clang++ -std=c++17 -fno-rtti -O2 -stdlib=libc++ -Wfatal-errors -o main src2/main.cpp $SRC -Iinclude -ldl
|
@ -1,6 +1,6 @@
|
|||||||
python3 prebuild.py
|
python3 prebuild.py
|
||||||
SRC=$(find src/ -name "*.cpp")
|
SRC=$(find src/ -name "*.cpp")
|
||||||
clang++ -pg -O1 -std=c++17 -fno-rtti -stdlib=libc++ -Wfatal-errors -o pocketpy $SRC -Iinclude
|
clang++ -pg -O1 -std=c++17 -fno-rtti -stdlib=libc++ -Wfatal-errors -o main $SRC -Iinclude
|
||||||
time ./main benchmarks/fib.py
|
time ./main benchmarks/fib.py
|
||||||
mv benchmarks/gmon.out .
|
mv benchmarks/gmon.out .
|
||||||
gprof pocketpy gmon.out > gprof.txt
|
gprof pocketpy gmon.out > gprof.txt
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
python3 prebuild.py
|
python3 prebuild.py
|
||||||
SRC=$(find src/ -name "*.cpp")
|
SRC=$(find src/ -name "*.cpp")
|
||||||
clang++ -std=c++17 -fno-rtti --coverage -O1 -stdlib=libc++ -Wfatal-errors -o pocketpy src2/main.cpp $SRC -Iinclude
|
clang++ -std=c++17 -fno-rtti --coverage -O1 -stdlib=libc++ -Wfatal-errors -o main src2/main.cpp $SRC -Iinclude
|
||||||
python3 scripts/run_tests.py
|
python3 scripts/run_tests.py
|
||||||
rm -rf .coverage
|
rm -rf .coverage
|
||||||
mkdir .coverage
|
mkdir .coverage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user