Compare commits

..

No commits in common. "480a2646e4b9e37c8133cbedc29b2a9bb4d89929" and "b7cda8969e2682fb5ef3f822cc47a8a8ef1fc67b" have entirely different histories.

4 changed files with 16 additions and 23 deletions

View File

@ -6,11 +6,10 @@ 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 PK_BUILD_WITH_IPO)
if(result AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
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 -DPK_BUILD_WITH_IPO=OFF"
FLAGS="-DCMAKE_TOOLCHAIN_FILE=3rd/ios.toolchain.cmake -DPK_BUILD_STATIC_LIB=ON -DDEPLOYMENT_TARGET=13.0"
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+8
version: 2.0.1+7
homepage: https://pocketpy.dev
repository: https://github.com/pocketpy/pocketpy

View File

@ -1,29 +1,23 @@
#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;
#ifdef CLOCK_REALTIME
clock_gettime(CLOCK_REALTIME, &tms);
#else
/* The C11 way */
timespec_get(&tms, TIME_UTC);
#endif
/* seconds, multiplied with 1 billion */
int64_t nanos = tms.tv_sec * NANOS_PER_SEC;
/* Add full nanoseconds */
nanos += tms.tv_nsec;
return nanos;
}
int64_t time_ns() {
struct timespec tms;
#if defined( __ANDROID__) || defined(__MINGW32__) || defined(__MINGW64__)
clock_gettime(CLOCK_REALTIME, &tms);
#else
int64_t time_ns() {
return 0;
}
/* The C11 way */
timespec_get(&tms, TIME_UTC);
#endif
/* seconds, multiplied with 1 billion */
int64_t nanos = tms.tv_sec * NANOS_PER_SEC;
/* Add full nanoseconds */
nanos += tms.tv_nsec;
return nanos;
}
static bool time_time(int argc, py_Ref argv) {
PY_CHECK_ARGC(0);