Skip to content

Commit 95d32cb

Browse files
linesightclaude
andcommitted
Fix Linux CI build: C++20 standard, subprocess link, removed APIs
- Remove -std=gnu++11 from Linux target_compile_options so CMAKE_CXX_STANDARD 20 governs (fixes hundreds of CEF 146 C++20 header errors) - Add libcef.so to cefpython_subprocess link on Linux (fixes undefined cef_* symbol errors) - Replace removed GdkNativeWindow (GTK2) with unsigned long for gtk_plug_new on Linux - Remove CefOverridePath calls and declaration (removed from CEF 146 public API) - Guard CefSetOSModalLoop as Windows-only (was always cef_win.h only) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1c516db commit 95d32cb

7 files changed

Lines changed: 12 additions & 19 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ elseif(APPLE)
223223
)
224224
else()
225225
target_compile_options(${MODULE_NAME} PRIVATE
226-
-std=gnu++11 -DNDEBUG -O3
226+
-DNDEBUG -O3
227227
-flto -fdata-sections -ffunction-sections
228228
)
229229
target_compile_definitions(${MODULE_NAME} PRIVATE

src/cefpython.pyx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -452,16 +452,6 @@ def Initialize(applicationSettings=None, commandLineSwitches=None, **kwargs):
452452
del command_line_switches
453453
del commandLineSwitches
454454

455-
IF UNAME_SYSNAME == "Linux":
456-
# Fix Issue #231 - Discovery of the "icudtl.dat" file fails on Linux.
457-
cdef str py_module_dir = GetModuleDirectory()
458-
cdef CefString cef_module_dir
459-
PyToCefString(py_module_dir, cef_module_dir)
460-
CefOverridePath(PK_DIR_EXE, cef_module_dir)\
461-
or Debug("ERROR: CefOverridePath failed")
462-
CefOverridePath(PK_DIR_MODULE, cef_module_dir)\
463-
or Debug("ERROR: CefOverridePath failed")
464-
# END IF UNAME_SYSNAME == "Linux":
465455

466456
if not application_settings:
467457
application_settings = {}
@@ -983,9 +973,10 @@ def Shutdown():
983973
MacShutdown()
984974

985975
def SetOsModalLoop(py_bool modalLoop):
986-
cdef cpp_bool cefModalLoop = bool(modalLoop)
987-
with nogil:
988-
CefSetOSModalLoop(cefModalLoop)
976+
IF UNAME_SYSNAME == "Windows":
977+
cdef cpp_bool cefModalLoop = bool(modalLoop)
978+
with nogil:
979+
CefSetOSModalLoop(cefModalLoop)
989980

990981
cpdef py_void SetGlobalClientCallback(object name, object callback):
991982
global g_globalClientCallbacks

src/extern/cef/cef_app.pxd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,7 @@ cdef extern from "include/cef_app.h":
3030
cdef void CefDoMessageLoopWork() nogil
3131
cdef void CefQuitMessageLoop() nogil
3232
cdef void CefShutdown() nogil
33-
cdef void CefSetOSModalLoop(cpp_bool osModalLoop) nogil
33+
34+
IF UNAME_SYSNAME == "Windows":
35+
cdef extern from "include/internal/cef_win.h":
36+
cdef void CefSetOSModalLoop(cpp_bool osModalLoop) nogil

src/extern/cef/cef_path_util.pxd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ from libcpp cimport bool as cpp_bool
88

99
cdef extern from "include/cef_path_util.h" nogil:
1010
cpp_bool CefGetPath(PathKey key, CefString& path)
11-
cpp_bool CefOverridePath(PathKey key, const CefString& path)

src/extern/linux.pxd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
# Project website: https://github.com/cztomczak/cefpython
44

55
cdef extern from "gtk/gtk.h" nogil:
6-
ctypedef void* GdkNativeWindow
76
ctypedef void* GtkWidget
8-
cdef GtkWidget* gtk_plug_new(GdkNativeWindow socket_id)
7+
cdef GtkWidget* gtk_plug_new(unsigned long socket_id)
98
cdef void gtk_widget_show(GtkWidget* widget)
109

1110
ctypedef char* XPointer

src/subprocess/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,6 @@ else()
152152
CEFPYTHON_API_H_FILE="cefpython_api_fixed.h")
153153
target_link_libraries(cefpython_subprocess PRIVATE
154154
"${CEFPYTHON_CEF_ROOT}/lib/libcef_dll_wrapper.a"
155+
"${CEFPYTHON_CEF_ROOT}/bin/libcef.so"
155156
)
156157
endif()

src/window_utils_linux.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class WindowUtils:
4141

4242
@classmethod
4343
def gtk_plug_new(cls, WindowHandle gdkNativeWindow):
44-
return <WindowHandle>gtk_plug_new(<GdkNativeWindow>gdkNativeWindow)
44+
return <WindowHandle>gtk_plug_new(<unsigned long>gdkNativeWindow)
4545

4646
@classmethod
4747
def gtk_widget_show(cls, WindowHandle gtkWidgetPtr):

0 commit comments

Comments
 (0)