add linux build

Update build_linux.sh
This commit is contained in:
blueloveTH 2023-02-07 17:21:37 +08:00
parent 1f3b52e9ac
commit ec7a7f6578
3 changed files with 6 additions and 1 deletions

View File

@ -52,11 +52,13 @@ jobs:
- name: Compiling - name: Compiling
run: | run: |
bash build_cpp.sh bash build_cpp.sh
bash build_linux.sh
python3 scripts/run_tests.py python3 scripts/run_tests.py
./pocketpy tests/1.py ./pocketpy tests/1.py
./pocketpy tests/2.py ./pocketpy tests/2.py
mkdir -p output/linux/x86_64 mkdir -p output/linux/x86_64
mv pocketpy output/linux/x86_64 mv pocketpy output/linux/x86_64
mv pocketpy.so output/linux/x86_64
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
path: output path: output

3
build_linux.sh Normal file
View File

@ -0,0 +1,3 @@
echo '#include "pocketpy.h"' > src/tmp.cpp
g++ -fPIC -shared -o pocketpy.so src/tmp.cpp --std=c++17 -O2 -Wall -Wno-sign-compare -Wno-unused-variable -fno-rtti
rm src/tmp.cpp

View File

@ -1,4 +1,4 @@
g++ -o pocketpy src/main.cpp --std=c++17 -pg -O1 -pthread -fno-rtti g++ -o pocketpy src/main.cpp --std=c++17 -pg -O1 -fno-rtti
./pocketpy tests/1.py ./pocketpy tests/1.py