Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Python language bindings to v1.2.x #2315

Merged
merged 33 commits into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
726abf0
Update pocketpy
blueloveTH Sep 27, 2023
db284e0
some initial try
blueloveTH Sep 27, 2023
18bf625
some more update
blueloveTH Sep 27, 2023
7da8523
fix a bug
blueloveTH Sep 27, 2023
19126e6
some more fix
blueloveTH Sep 27, 2023
dd162d5
some more fix
blueloveTH Sep 27, 2023
61cb705
a small fix
blueloveTH Sep 27, 2023
c5705e7
Update CMakeLists.txt
blueloveTH Sep 27, 2023
23d87ab
Update CMakeLists.txt
blueloveTH Sep 28, 2023
167384e
...
blueloveTH Sep 28, 2023
a7305f3
small update
blueloveTH Sep 28, 2023
403859b
Update pocketpy
blueloveTH Sep 28, 2023
c0c605c
Update pocketpy
blueloveTH Sep 28, 2023
38ee7f9
try fix cmake error
blueloveTH Sep 28, 2023
f3287c3
...
blueloveTH Sep 28, 2023
7cf65f4
Update CMakeLists.txt
blueloveTH Sep 28, 2023
c189a5d
some update
blueloveTH Sep 28, 2023
7392d9b
Update CMakeLists.txt
blueloveTH Sep 28, 2023
e72b275
Update build.yml
blueloveTH Sep 28, 2023
d4c18ab
Update python.c
blueloveTH Sep 28, 2023
039a7c6
Update python.c
blueloveTH Sep 28, 2023
1133bf7
...
blueloveTH Sep 28, 2023
851a4aa
...
blueloveTH Sep 28, 2023
552fee4
...
blueloveTH Sep 28, 2023
7fec01d
...
blueloveTH Sep 28, 2023
b17928c
...
blueloveTH Sep 28, 2023
8071889
Update pocketpy
blueloveTH Sep 28, 2023
559d4ad
some clean
blueloveTH Sep 28, 2023
8d07e70
fix https://github.com/nesbox/TIC-80/issues/2317
blueloveTH Sep 28, 2023
06ba51c
Update pocketpy
blueloveTH Sep 29, 2023
45977f1
Update pocketpy
blueloveTH Oct 5, 2023
5d2bffe
Update pocketpy
blueloveTH Oct 7, 2023
60f4734
Merge branch 'main' of https://github.com/blueloveTH/TIC-80
blueloveTH Oct 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ jobs:
runs-on: windows-2019

steps:
# https://github.com/actions/runner-images/issues/2642#issuecomment-774988591
- name: configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.2
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.opendb
*.suo
compile_commands.json
compile_flags.txt
sexit
.vscode/
build/install_manifest.txt
Expand Down
39 changes: 12 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -397,39 +397,24 @@ target_include_directories(squirrel PRIVATE ${SQUIRREL_DIR}/squirrel)
target_include_directories(squirrel PRIVATE ${SQUIRREL_DIR}/sqstdlib)

################################
# PocketPy (Python)
# pocketpy (Python)
################################

set(POCKETPY_DIR ${THIRDPARTY_DIR}/pocketpy)
add_subdirectory(${THIRDPARTY_DIR}/pocketpy)
target_compile_definitions(pocketpy PRIVATE PK_ENABLE_OS=0)
include_directories(${THIRDPARTY_DIR}/pocketpy/include)

if (${CMAKE_VERSION} VERSION_LESS "3.12.0")
set(Python3_EXECUTABLE "python3")
else()
find_package(Python3 COMPONENTS Interpreter)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(pocketpy PRIVATE -Wno-psabi)
endif()

add_custom_command(
OUTPUT ${POCKETPY_DIR}/src/_generated.h
COMMAND ${Python3_EXECUTABLE} preprocess.py
WORKING_DIRECTORY ${POCKETPY_DIR}
DEPENDS ${POCKETPY_DIR}/preprocess.py
)

add_library(python STATIC
${POCKETPY_DIR}/src/_generated.h
${POCKETPY_DIR}/c_bindings/pocketpy_c.cpp
)

set_target_properties(python PROPERTIES LINKER_LANGUAGE CXX)
target_compile_definitions(python PRIVATE PK_ENABLE_OS=0)
target_include_directories(python
PRIVATE ${POCKETPY_DIR}/src
PUBLIC ${POCKETPY_DIR}/c_bindings)
# alias pocketpy to python for next steps
set_target_properties(pocketpy PROPERTIES OUTPUT_NAME python)
add_library(python ALIAS pocketpy)

if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
set_target_properties(python PROPERTIES COMPILE_FLAGS "--std=c++17")
else()
target_compile_features(python PRIVATE cxx_std_17)
if(EMSCRIPTEN)
# exceptions must be enabled for emscripten
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fexceptions")
endif()

################################
Expand Down
Loading
Loading