some cleanup

This commit is contained in:
blueloveTH 2024-01-20 22:52:30 +08:00
parent d97b24f5cb
commit 74ffb3f6ed
7 changed files with 14 additions and 18 deletions

17
.gitignore vendored
View File

@ -5,22 +5,19 @@ __pycache__/
.coverage .coverage
.idea .idea
src/main
gmon.out gmon.out
gprof.txt gprof.txt
/pocketpy
amalgamated amalgamated
web/lib web/lib
*.a *.a
*.so *.so
*.dll *.dll
*.dylib
plugins/unity/ plugins/unity/
plugins/macos/pocketpy/pocketpy.* plugins/macos/pocketpy/pocketpy.*
include/pocketpy/_generated.h include/pocketpy/_generated.h
profile.sh
test
src/httplib.h
main.exe main.exe
main.obj main.obj
pocketpy.exp pocketpy.exp
@ -28,13 +25,7 @@ pocketpy.lib
APPS APPS
build build
pocketpy.dSYM
main main
pocketpy.dSYM
pypi/
libpocketpy.dylib
.xmake/
libpocketpy.dylib.dSYM/ libpocketpy.dylib.dSYM/
main.dSYM/ main.dSYM/

View File

@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.

View File

@ -31,6 +31,7 @@ SRC=$(find src/ -name "*.cpp")
echo "> Compiling and linking source files... " echo "> Compiling and linking source files... "
FLAGS="-std=c++17 -O1 -stdlib=libc++ -Wfatal-errors -Iinclude" FLAGS="-std=c++17 -O1 -stdlib=libc++ -Wfatal-errors -Iinclude"
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then
LIB_EXTENSION=".dylib" LIB_EXTENSION=".dylib"
FLAGS="$FLAGS -undefined dynamic_lookup" FLAGS="$FLAGS -undefined dynamic_lookup"

View File

@ -1,8 +1,11 @@
-xc++ -xc++
-Wall -Wall
-W* -W*
-std=c++17 -std=c++17
-stdlib=libc++ -stdlib=libc++
-Iinclude/ -Iinclude/
-I3rd/cjson/include/ -I3rd/cjson/include/
-I3rd/lua_bridge/include/ -I3rd/lua_bridge/include/

View File

@ -1,5 +1,4 @@
import os import os
from datetime import datetime
def generate_python_sources(): def generate_python_sources():
sources = {} sources = {}
@ -15,10 +14,9 @@ def generate_python_sources():
new_value.append("\\x" + value[i:i+2]) new_value.append("\\x" + value[i:i+2])
sources[key] = "".join(new_value) sources[key] = "".join(new_value)
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
header = '''#pragma once header = '''#pragma once
// generated on ''' + timestamp + ''' // generated by prebuild.py
#include <map> #include <map>
#include <string> #include <string>

View File

@ -6,8 +6,10 @@ cmake ..
cmake --build . --config Release cmake --build . --config Release
./test_c_bindings > binding_test_scratch ./test_c_bindings > binding_test_scratch
echo "checking results (they should be identical)" echo "checking results (they should be identical)"
diff -q -s binding_test_scratch ../test_answers.txt diff -q -s binding_test_scratch ../test_answers.txt
if [ $? -eq 1 ] if [ $? -eq 1 ]
then then
echo "ERROR: c binding test failed" echo "ERROR: c binding test failed"

View File

@ -11,8 +11,10 @@ fi
rm -rf .coverage rm -rf .coverage
mkdir .coverage mkdir .coverage
rm pocketpy_c.gcno rm pocketpy_c.gcno
UNITS=$(find ./ -name "*.gcno") UNITS=$(find ./ -name "*.gcno")
llvm-cov-15 gcov ${UNITS} -r -s include/ -r -s src/ >> .coverage/coverage.txt llvm-cov-15 gcov ${UNITS} -r -s include/ -r -s src/ >> .coverage/coverage.txt
mv *.gcov .coverage mv *.gcov .coverage
rm *.gcda rm *.gcda
rm *.gcno rm *.gcno