16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 11:39:19 +02:00

Python 3.14 build and CI updates

Squashes the last five commits: migrate to Python 3.14 (CMake, AppVeyor, Azure, README), vcpkg/setup-ci fixes, CMake adjustments, remove bundled ref/python 2.7, and related scripting/static file updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
maj00r
2026-05-11 16:22:17 +02:00
parent 6542021253
commit 3786ecd98f
104 changed files with 130 additions and 13532 deletions

View File

@@ -69,7 +69,7 @@ endif()
option(WITH_OPENGL_MODERN "Compile with OpenGL modern renderer" ON)
option(WITH_OPENGL_LEGACY "Compile with OpenGL legacy renderer" ON)
option(WITH_PYTHON "Compile with python2" ON)
option(WITH_PYTHON "Compile with python3" ON)
option(WITH_UART "Compile with libserialport" ON)
option(WITH_LUA "Compile with lua scripting support" ON)
option(WITH_OPENVR "Compile with OpenVR" OFF)
@@ -81,6 +81,9 @@ option(WITH_BETTER_RENDERER "Experimental multi-backend renderer based on NVRHI"
option(GENERATE_PDB "Generate executable with program debugging symbols" ON)
option(ENABLE_MCC "Enable multicore compilation" ON)
option(WITHDUMPGEN "Enable generating DMP files on crash" ON)
if(WIN32)
option(WITH_PYTHON_AUTO_INSTALL_WIN "If Python 3.14 Development is missing, install into tools/python314 (network)" ON)
endif()
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
@@ -354,7 +357,6 @@ if (WIN32)
set(OPENAL_INCLUDE_DIR ${OPENAL_INCLUDE_DIR} "${DEPS_DIR}/openal/include")
set(LIBSNDFILE_INCLUDE_DIR ${LIBSNDFILE_INCLUDE_DIR} "${DEPS_DIR}/libsndfile/include")
set(LUAJIT_INCLUDE_DIR ${LUAJIT_INCLUDE_DIR} "${DEPS_DIR}/luajit/include")
set(PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR} "${DEPS_DIR}/python/include")
set(libserialport_INCLUDE_DIR ${LIBSERIALPORT_INCLUDE_DIR} "${DEPS_DIR}/libserialport/include")
set(OPENVR_INCLUDE_DIR "${DEPS_DIR}/openvr/include")
@@ -372,7 +374,6 @@ if (WIN32)
set(OPENAL_LIBRARY ${OPENAL_LIBRARY} "${DEPS_DIR}/openal/lib/${ARCH}/OpenAL32.lib")
set(LIBSNDFILE_LIBRARY ${LIBSNDFILE_LIBRARY} "${DEPS_DIR}/libsndfile/lib/${ARCH}/libsndfile-1.lib")
set(LUAJIT_LIBRARIES ${LUAJIT_LIBRARIES} "${DEPS_DIR}/luajit/lib/${ARCH}/lua51.lib")
set(PYTHON_LIBRARY ${PYTHON_LIBRARY} "${DEPS_DIR}/python/lib/${ARCH}/python27.lib")
set(libserialport_LIBRARY ${LIBSERIALPORT_LIBRARY} "${DEPS_DIR}/libserialport/lib/${ARCH}/libserialport-0.lib")
set(cppzmq_LIBRARY ${cppzmq_LIBRARY} "${DEPS_DIR}/cppzmq/lib/${ARCH}/libzmq.lib")
set(OPENVR_LIBRARY "${DEPS_DIR}/openvr/lib/${ARCH}/openvr_api.lib")
@@ -466,10 +467,39 @@ endif()
target_link_libraries(${PROJECT_NAME} glfw)
if (WITH_PYTHON)
find_package(PythonLibs 2 REQUIRED)
target_include_directories(${PROJECT_NAME} PRIVATE ${PYTHON_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${PYTHON_LIBRARIES})
if(WITH_PYTHON)
set(_py_tools "${CMAKE_SOURCE_DIR}/tools/python314")
set(_pyv 3.14.0)
if(WIN32)
if(EXISTS "${_py_tools}/python.exe" AND NOT Python3_ROOT_DIR)
set(Python3_ROOT_DIR "${_py_tools}" CACHE PATH "Python 3.14 (tools/python314)")
endif()
find_package(Python3 3.14 QUIET COMPONENTS Development)
endif()
find_package(Python3 3.14 REQUIRED COMPONENTS Development)
target_include_directories(${PROJECT_NAME} PRIVATE ${Python3_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${Python3_LIBRARIES})
if(WIN32)
cmake_path(GET Python3_EXECUTABLE PARENT_PATH _px)
set(_rt "")
if(Python3_RUNTIME_LIBRARY_DIRS)
list(GET Python3_RUNTIME_LIBRARY_DIRS 0 _rt)
endif()
if(NOT _rt)
set(_rt "${_px}")
endif()
set(EU07_PY_DLL "${_rt}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}.dll")
set(EU07_PY_ZLIB "${_rt}/zlib1.dll")
set(EU07_PY_LIBDIR "${_px}/Lib")
set(EU07_PY_DLLSDIR "${_px}/DLLs")
set(_vpt "${VCPKG_INSTALLED_PATH}/tools/python3")
if(NOT EXISTS "${EU07_PY_LIBDIR}")
set(EU07_PY_LIBDIR "${_vpt}/Lib")
endif()
if(NOT EXISTS "${EU07_PY_DLLSDIR}")
set(EU07_PY_DLLSDIR "${_vpt}/DLLs")
endif()
endif()
endif()
if (NOT WIN32)
@@ -552,6 +582,23 @@ if (WIN32)
)
endif ()
if(WIN32 AND WITH_PYTHON)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${EU07_PY_DLL}" "$<TARGET_FILE_DIR:${PROJECT_NAME}>"
)
if(EXISTS "${EU07_PY_ZLIB}")
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${EU07_PY_ZLIB}" "$<TARGET_FILE_DIR:${PROJECT_NAME}>"
)
endif()
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${EU07_PY_LIBDIR}" "$<TARGET_FILE_DIR:${PROJECT_NAME}>/python64/Lib"
)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${EU07_PY_DLLSDIR}" "$<TARGET_FILE_DIR:${PROJECT_NAME}>/python64/DLLs"
)
endif()
if (WITH_BETTER_RENDERER)
add_subdirectory("betterRenderer")
set_target_properties(betterRenderer betterRenderer_fsr2 betterRenderer_shaders PROPERTIES FOLDER "renderers")