Skip to content

Commit b5d8f71

Browse files
committed
WIP
1 parent b3623c0 commit b5d8f71

File tree

6 files changed

+53
-4
lines changed

6 files changed

+53
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
CXX: g++-10
8989
strategy:
9090
matrix:
91-
python-version: ["3.14"]
91+
python-version: ["3.12"]
9292

9393
steps:
9494

@@ -107,6 +107,14 @@ jobs:
107107
python -c "import sysconfig; print('platinclude=', sysconfig.get_paths().get('platinclude'))"
108108
python -c "import sysconfig; print('EXT_SUFFIX=', sysconfig.get_config_var('EXT_SUFFIX'))"
109109
110+
- name: Show Python build paths 2
111+
run: |
112+
cd /opt/hostedtoolcache/Python/3.12.12/x64
113+
ls
114+
cd include
115+
cd python3.12
116+
ls
117+
110118
- name: Install Dependencies
111119
run: |
112120
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
@@ -129,6 +137,7 @@ jobs:
129137
cd ..
130138
git clone https://github.com/PilotLightTech/pilotlight
131139
cd pilotlight-python
140+
python -m pip install pl-build
132141
133142
- name: Build Package
134143
run: |

pilotlight/pilotlight.so

-4.88 MB
Binary file not shown.

scripts/gen_build.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,14 @@
257257
pl.add_compiler_flags("-Zc:preprocessor", "-nologo", "-std:c11", "-W4", "-WX", "-wd4201",
258258
"-wd4100", "-wd4996", "-wd4505", "-wd4189", "-wd5105", "-wd4115",
259259
"-permissive-", "-Od", "-MDd", "-Zi")
260-
pl.set_post_target_build_step('@copy "%VULKAN_SDK%\\bin\\spirv-cross-c-shared.dll" "..\\pilotlight\\" >nul\n')
260+
pl.set_post_target_build_step(
261+
'@copy "%VULKAN_SDK%\\bin\\spirv-cross-c-shared.dll" "..\\pilotlight\\" >nul\n'
262+
'@copy "..\\dependencies\\cpython\\PCbuild\\amd64\\python314_d.dll" "..\\out\\" >nul\n'
263+
'@copy "..\\dependencies\\cpython\\PCbuild\\amd64\\python314.dll" "..\\out\\" >nul\n'
264+
'@copy "..\\dependencies\\cpython\\PCbuild\\amd64\\python3.dll" "..\\out\\" >nul\n'
265+
'@copy "..\\dependencies\\cpython\\PCbuild\\amd64\\python3_d.dll" "..\\out\\" >nul\n'
266+
)
267+
261268

262269
with pl.platform("Linux"):
263270
with pl.compiler("gcc"):
@@ -297,6 +304,21 @@
297304
"-permissive-", "-Od", "-MD", "-Zi")
298305
pl.set_post_target_build_step('@copy "%VULKAN_SDK%\\bin\\spirv-cross-c-shared.dll" "..\\pilotlight\\" >nul\n')
299306

307+
with pl.platform("Linux"):
308+
with pl.compiler("gcc"):
309+
310+
pl.add_include_directories("/opt/hostedtoolcache/Python/3.12.12/x64/include/python3.12")
311+
pl.add_link_directories("/opt/hostedtoolcache/Python/3.12.12/x64/libs")
312+
313+
pl.add_definitions("PL_VULKAN_BACKEND")
314+
pl.add_include_directories('$VULKAN_SDK/include', '/usr/include/vulkan')
315+
pl.set_output_binary_extension(".so")
316+
pl.add_compiler_flags("-fPIC")
317+
pl.add_compiler_flags("--debug -g")
318+
pl.add_linker_flags("-ldl -lm")
319+
pl.add_dynamic_link_libraries("shaderc_shared", "spirv-cross-c-shared", "vulkan")
320+
pl.add_static_link_libraries("glfw", "pl_platform_ext")
321+
pl.add_link_directories('$VULKAN_SDK/lib')
300322

301323
#-----------------------------------------------------------------------------
302324
# [SECTION] generate scripts

setup.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ def setup_package():
4848
'Intended Audience :: Developers',
4949
'Intended Audience :: Science/Research',
5050
'Operating System :: Microsoft :: Windows :: Windows 10',
51+
'Operating System :: POSIX',
52+
'Operating System :: Unix',
53+
'Programming Language :: Python :: 3.12',
5154
'Programming Language :: Python :: 3.14',
5255
'Programming Language :: Python :: Implementation :: CPython',
5356
'Programming Language :: Python :: 3 :: Only',
@@ -71,6 +74,17 @@ def setup_package():
7174
"pl_vfs_ext.py",
7275
"spirv-cross-c-shared.dll"
7376
]
77+
else:
78+
metadata['package_data']['pilotlight'] = [
79+
"__init__.py",
80+
"pilotlight.so",
81+
"pilotlight.pyi",
82+
"pl_core.py",
83+
"pl_draw_ext.py",
84+
"pl_starter_ext.py",
85+
"pl_ui_ext.py",
86+
"pl_vfs_ext.py"
87+
]
7488

7589
if "--force" in sys.argv:
7690
sys.argv.remove('--force')

src/build_linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ PL_RESULT=${BOLD}${GREEN}Successful.${NC}
269269
PL_DEFINES="-D_USE_MATH_DEFINES -DPy_PYTHON_H "
270270
PL_INCLUDE_DIRECTORIES="-I../src -I../../pilotlight/libs -I../../pilotlight/extensions -I../../pilotlight/dependencies/stb -I../../pilotlight/src "
271271
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out -L../../pilotlight/out -Wl,-rpath,../../pilotlight/out "
272-
PL_COMPILER_FLAGS=""
273-
PL_LINKER_FLAGS=""
272+
PL_COMPILER_FLAGS="-fPIC "
273+
PL_LINKER_FLAGS="-ldl -lm "
274274
PL_STATIC_LINK_LIBRARIES=""
275275
PL_DYNAMIC_LINK_LIBRARIES="-lpthread "
276276
# # run compiler only

src/build_win32.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ cl %PL_INCLUDE_DIRECTORIES% %PL_DEFINES% %PL_COMPILER_FLAGS% %PL_SOURCES% -Fe"..
221221
@echo ~~~~~~~~~~~~~~~~~~~~~~
222222

223223
@copy "%VULKAN_SDK%\bin\spirv-cross-c-shared.dll" "..\pilotlight\" >nul
224+
@copy "..\dependencies\cpython\PCbuild\amd64\python314_d.dll" "..\out\" >nul
225+
@copy "..\dependencies\cpython\PCbuild\amd64\python314.dll" "..\out\" >nul
226+
@copy "..\dependencies\cpython\PCbuild\amd64\python3.dll" "..\out\" >nul
227+
@copy "..\dependencies\cpython\PCbuild\amd64\python3_d.dll" "..\out\" >nul
224228

225229

226230
:Exit_pilotlight

0 commit comments

Comments
 (0)