mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-23 04:50: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
|
||||
- name: Benchmark
|
||||
run: python3 scripts/run_tests.py benchmark
|
||||
# - name: GCC Build Test
|
||||
# run: g++ -o pocketpy --std=c++17 src/main.cpp
|
||||
- name: GCC Build Test
|
||||
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
|
||||
run: bash run_c_binding_test.sh
|
||||
build_macos:
|
||||
|
@ -43,10 +43,6 @@ To compile it with your project, these flags must be set:
|
||||
+ RTTI is not required
|
||||
+ If clang is used, `-stdlib=libc++` must be set
|
||||
|
||||
!!!
|
||||
For maximum performance, we recommend to use `clang++` with `-O2` flag.
|
||||
!!!
|
||||
|
||||
### Example
|
||||
|
||||
```cpp
|
||||
|
@ -81,10 +81,10 @@ with open("amalgamated/main.cpp", "wt", encoding='utf-8') as f:
|
||||
f.write(text)
|
||||
|
||||
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:
|
||||
print("Test build success!")
|
||||
os.remove("pocketpy")
|
||||
os.remove("main")
|
||||
|
||||
print("amalgamated/pocketpy.h")
|
||||
|
||||
|
2
build.sh
2
build.sh
@ -1,3 +1,3 @@
|
||||
python3 prebuild.py
|
||||
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
|
||||
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
|
||||
mv benchmarks/gmon.out .
|
||||
gprof pocketpy gmon.out > gprof.txt
|
||||
|
@ -1,6 +1,6 @@
|
||||
python3 prebuild.py
|
||||
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
|
||||
rm -rf .coverage
|
||||
mkdir .coverage
|
||||
|
Loading…
x
Reference in New Issue
Block a user