diff --git a/.github/workflows/build_internal.yml b/.github/workflows/build_internal.yml index 3ec7082..c49823b 100644 --- a/.github/workflows/build_internal.yml +++ b/.github/workflows/build_internal.yml @@ -30,7 +30,7 @@ jobs: - os: windows-latest qthost: windows qtarch: win64_msvc2019_64 - version: 6.4.3 + version: 6.6.2 pythonversion: 3.8.10 arch: x64 binding: PyQt6 @@ -51,7 +51,7 @@ jobs: - os: ubuntu-latest qthost: linux qtarch: gcc_64 - version: 6.4.3 + version: 6.6.2 pythonversion: 3.8.12 arch: x64 binding: PyQt6 diff --git a/README.md b/README.md index ddfac9b..600a14b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ PyQt5: `pip install PyQt5-ElaWidgetTools`,PyQt5>=5.15.5 -PyQt6: `pip install PyQt6-ElaWidgetTools`,PyQt6>=6.4.2 +PyQt6: `pip install PyQt6-ElaWidgetTools`,PyQt6>=6.6.2 PySide6: `pip install PySide6-ElaWidgetTools`,PySide6==6.6.2 diff --git a/scripts/dobuild.py b/scripts/dobuild.py index 23b8c2f..a8836e6 100644 --- a/scripts/dobuild.py +++ b/scripts/dobuild.py @@ -1,4 +1,4 @@ -import sys, os, subprocess, shutil, site +import sys, os, subprocess, shutil, site, io print(sys.platform) print(sys.executable) @@ -41,7 +41,7 @@ if binding.lower().startswith("pyqt"): if qtversion.startswith("6"): subprocess.run( - f"{pyPath} -m pip install pyqt6==6.4.2 PyQt-builder sip", shell=True + f"{pyPath} -m pip install pyqt6==6.6.1 PyQt-builder sip", shell=True ) else: subprocess.run( @@ -54,13 +54,18 @@ shell=True, ) +sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace") + # 编译ela -def __parsefile(fn, cb): +def __parsefile(fn, cb, pr=False): with open(fn, "r", encoding="utf8") as ff: cml = ff.read() with open(fn, "w", encoding="utf8") as ff: - ff.write(cb(cml)) + _ = cb(cml) + if pr: + print(_) + ff.write(_) __parsefile( @@ -77,6 +82,29 @@ def __parsefile(fn, cb): if sys.platform == "win32": archA = ("win32", "x64")[arch == "x64"] flags = f'-G "Visual Studio 18 2026" -A {archA} -T host={arch}' + + if binding.lower() == "pyqt6": + fix = r""" + if(MSVC AND MSVC_VERSION GREATER_EQUAL 1940) # VS2026 的 _MSC_VER 约为 1940+ + message(STATUS "Detected VS2026 or newer, adding compatibility definitions") + add_compile_definitions( + _SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS + _HAS_CXX17=1 + _HAS_CXX20=1 + _CRT_SECURE_NO_WARNINGS + ) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /Zc:__cplusplus") + endif() + + """ + __parsefile( + "../ElaWidgetTools/CMakeLists.txt", + lambda c: c.replace( + "add_definitions(-DELAWIDGETTOOLS_LIBRARY)", + "add_definitions(-DELAWIDGETTOOLS_LIBRARY)\n" + fix, + ), + pr=True, + ) else: flags = "" subprocess.run( diff --git a/scripts/pyside6/gen_xml.py b/scripts/pyside6/gen_xml.py index afe077f..6ed2ea5 100644 --- a/scripts/pyside6/gen_xml.py +++ b/scripts/pyside6/gen_xml.py @@ -289,22 +289,6 @@ def maybeparse(xx: str): ff.write(wrapperbase.format(internal=H_internal + "\n" + h)) -sysinclude = "" -if "msvc2019" in MY_QT_INSTALL: - # <=6.7必须使用msvc2019的头文件 - vspath = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC" - if not os.path.exists(vspath): - vspath = ( - "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC" - ) - print(os.listdir(vspath)) - for _ in os.listdir(vspath): - if _.startswith("14.29"): - msvc2019 = _ - sysinclude = vspath + "/" + msvc2019 + "/include" - print(sysinclude) - sysinclude = f'--system-include-paths="{sysinclude}"' - if sys.platform=='linux': inc='/usr/lib/gcc/x86_64-linux-gnu/14/include' if not os.path.exists(inc): @@ -315,7 +299,7 @@ def maybeparse(xx: str): sysinclude = f' -I{inc} -I{pyDir} ' os.system( - f"""shiboken6 {sysinclude} + f"""shiboken6 --generator-set=shiboken --output-directory=OUTPUTDIR -I{ELA_INCLUDE_PATH} diff --git a/scripts/wheel/setup.py b/scripts/wheel/setup.py index 7b8751a..d9465e6 100644 --- a/scripts/wheel/setup.py +++ b/scripts/wheel/setup.py @@ -24,7 +24,7 @@ def has_ext_modules(self): if bindingfor == "PyQt5": req = "PyQt5>=5.15.5" elif bindingfor == "PyQt6": - req = "PyQt6>=6.4.2" + req = "PyQt6>=6.6.2" elif bindingfor == "PySide6": pass