Compare commits

...

6 Commits

Author SHA1 Message Date
blueloveTH
372325d663 ... 2024-08-22 17:47:04 +08:00
blueloveTH
a3218e1e2e ... 2024-08-22 17:40:47 +08:00
blueloveTH
a2576a3fce ... 2024-08-22 17:34:28 +08:00
blueloveTH
be417ea528 ... 2024-08-22 17:33:08 +08:00
blueloveTH
ec704ed67b ... 2024-08-22 17:11:56 +08:00
blueloveTH
953926342f enable IPO 2024-08-22 16:51:16 +08:00
6 changed files with 23 additions and 10 deletions

View File

@ -5,6 +5,19 @@ project(pocketpy)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
# use IPO
include(CheckIPOSupported)
check_ipo_supported(RESULT result)
if(result AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING ">> IPO disabled. You will get very poor performance!!")
message(WARNING ">> IPO disabled. You will get very poor performance!!")
message(WARNING ">> IPO disabled. You will get very poor performance!!")
endif()
if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8 /jumptablerdata /GS-")
add_compile_options(/wd4267 /wd4244)

View File

@ -8,7 +8,7 @@ from typing import List, Dict
assert os.system("python prebuild.py") == 0
ROOT = 'include/pocketpy'
PUBLIC_HEADERS = ['common/config.h', 'common/export.h', 'pocketpy.h']
PUBLIC_HEADERS = ['config.h', 'export.h', 'pocketpy.h']
COPYRIGHT = '''/*
* Copyright (c) 2024 blueloveTH

View File

@ -1,5 +1,7 @@
set -e
python amalgamate.py
rm -rf build
mkdir build
cd build
@ -12,9 +14,11 @@ cmake --build os64 --config Release
cmake -B simulatorarm64 -G Xcode $FLAGS -DPLATFORM=SIMULATORARM64 ..
cmake --build simulatorarm64 --config Release
HEADERS="../amalgamated/pocketpy.h"
xcodebuild -create-xcframework \
-library os64/Release-iphoneos/libpocketpy.a -headers ../include/pocketpy/pocketpy.h \
-library simulatorarm64/Release-iphonesimulator/libpocketpy.a -headers ../include/pocketpy/pocketpy.h \
-library os64/Release-iphoneos/libpocketpy.a -headers $HEADERS \
-library simulatorarm64/Release-iphonesimulator/libpocketpy.a -headers $HEADERS \
-output pocketpy.xcframework

View File

@ -31,10 +31,6 @@
#define PK_DEBUG_GC_STATS 0
#define PK_DEBUG_COMPILER 0
#ifndef PK_DEBUG_PRECOMPILED_EXEC
#define PK_DEBUG_PRECOMPILED_EXEC 0
#endif
/*************** internal settings ***************/
// This is the maximum size of the value stack in py_TValue units

View File

@ -5,8 +5,8 @@
#include <stdarg.h>
#include <stddef.h>
#include "pocketpy/common/config.h"
#include "pocketpy/common/export.h"
#include "pocketpy/config.h"
#include "pocketpy/export.h"
#ifdef __cplusplus
extern "C" {