mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
add -s
This commit is contained in:
parent
d9c3f6c146
commit
0a63fcb7b0
@ -20,7 +20,7 @@ endif()
|
|||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /utf-8 /O2")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /utf-8 /O2")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -O2")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -s -O2")
|
||||||
|
|
||||||
# disable -Wshorten-64-to-32 for apple
|
# disable -Wshorten-64-to-32 for apple
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
4
build.sh
4
build.sh
@ -30,7 +30,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 -s -O1 -stdlib=libc++ -Wfatal-errors -Iinclude"
|
||||||
|
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
LIB_EXTENSION=".dylib"
|
LIB_EXTENSION=".dylib"
|
||||||
@ -46,7 +46,7 @@ clang++ $FLAGS -o libpocketpy$LIB_EXTENSION $SRC -fPIC -shared
|
|||||||
# compile main.cpp and link to libpocketpy.so
|
# compile main.cpp and link to libpocketpy.so
|
||||||
echo "> Compiling main.cpp and linking to libpocketpy$LIB_EXTENSION..."
|
echo "> Compiling main.cpp and linking to libpocketpy$LIB_EXTENSION..."
|
||||||
|
|
||||||
clang++ $FLAGS -o main -O1 src2/main.cpp -L. -lpocketpy $LINK_FLAGS
|
clang++ $FLAGS -o main -s -O1 src2/main.cpp -L. -lpocketpy $LINK_FLAGS
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "Build completed. Type \"./main\" to enter REPL."
|
echo "Build completed. Type \"./main\" to enter REPL."
|
||||||
|
@ -4,4 +4,4 @@ rm -rf web/lib
|
|||||||
mkdir web/lib
|
mkdir web/lib
|
||||||
|
|
||||||
SRC=$(find src/ -name "*.cpp")
|
SRC=$(find src/ -name "*.cpp")
|
||||||
em++ $SRC -Iinclude/ -fexceptions -Os -sEXPORTED_FUNCTIONS=_pkpy_new_repl,_pkpy_repl_input,_pkpy_new_vm -sEXPORTED_RUNTIME_METHODS=ccall -o web/lib/pocketpy.js
|
em++ $SRC -Iinclude/ -fexceptions -s -Os -sEXPORTED_FUNCTIONS=_pkpy_new_repl,_pkpy_repl_input,_pkpy_new_vm -sEXPORTED_RUNTIME_METHODS=ccall -o web/lib/pocketpy.js
|
||||||
|
Loading…
x
Reference in New Issue
Block a user