Compare commits

...

9 Commits

Author SHA1 Message Date
blueloveTH
480a2646e4 Update pubspec.yaml 2024-11-08 20:10:57 +08:00
blueloveTH
ab4ff49eda ... 2024-11-08 18:23:46 +08:00
blueloveTH
eb280910c9 ... 2024-11-08 18:16:15 +08:00
blueloveTH
5cc224cb3e ... 2024-11-08 18:07:48 +08:00
blueloveTH
11868f12b2 Update build_ios.sh 2024-11-08 17:53:55 +08:00
blueloveTH
6541b0faba ... 2024-11-08 17:50:30 +08:00
blueloveTH
4cea396016 ... 2024-11-08 17:43:48 +08:00
blueloveTH
1ea83cf10b add PK_BUILD_WITH_IPO 2024-11-08 17:33:08 +08:00
blueloveTH
8a98208a75 ...
...
2024-11-08 17:09:48 +08:00
4 changed files with 23 additions and 16 deletions

View File

@ -6,10 +6,11 @@ set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
# use IPO
option(PK_BUILD_WITH_IPO "" TRUE)
include(CheckIPOSupported)
check_ipo_supported(RESULT result)
if(result AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
if(result AND PK_BUILD_WITH_IPO)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING ">> IPO disabled. You will not get the best performance.")

View File

@ -6,7 +6,7 @@ rm -rf build
mkdir build
cd build
FLAGS="-DCMAKE_TOOLCHAIN_FILE=3rd/ios.toolchain.cmake -DPK_BUILD_STATIC_LIB=ON -DDEPLOYMENT_TARGET=13.0"
FLAGS="-DCMAKE_TOOLCHAIN_FILE=3rd/ios.toolchain.cmake -DPK_BUILD_STATIC_LIB=ON -DDEPLOYMENT_TARGET=13.0 -DPK_BUILD_WITH_IPO=OFF"
cmake -B os64 -G Xcode $FLAGS -DPLATFORM=OS64 ..
cmake --build os64 --config Release

View File

@ -1,6 +1,6 @@
name: pocketpy
description: A lightweight Python interpreter for game engines. It supports Android/iOS/Windows/Linux/MacOS.
version: 2.0.1+7
version: 2.0.1+8
homepage: https://pocketpy.dev
repository: https://github.com/pocketpy/pocketpy

View File

@ -1,12 +1,13 @@
#include "pocketpy/pocketpy.h"
#include "pocketpy/interpreter/vm.h"
#include <time.h>
#include <assert.h>
#define NANOS_PER_SEC 1000000000
#ifndef __circle__
int64_t time_ns() {
struct timespec tms;
#if defined( __ANDROID__) || defined(__MINGW32__) || defined(__MINGW64__)
#ifdef CLOCK_REALTIME
clock_gettime(CLOCK_REALTIME, &tms);
#else
/* The C11 way */
@ -18,6 +19,11 @@ int64_t time_ns() {
nanos += tms.tv_nsec;
return nanos;
}
#else
int64_t time_ns() {
return 0;
}
#endif
static bool time_time(int argc, py_Ref argv) {
PY_CHECK_ARGC(0);