From 29759ef8fbb34d18035b2a33f4b1b7efc67da292 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Sat, 28 May 2022 18:22:53 +0200 Subject: [PATCH] obs-scripting: Fix missing frontend bindings for Python The obspython.i file requires `ENABLE_UI` to be defined for the swig compiler to pull in the actual obs-frontend-api header. If this is not the case, swig will not discover the required methods and ENUMs and in turn will not make those available in the scripting environment. --- deps/obs-scripting/obspython/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deps/obs-scripting/obspython/CMakeLists.txt b/deps/obs-scripting/obspython/CMakeLists.txt index a165f547a..341a32247 100644 --- a/deps/obs-scripting/obspython/CMakeLists.txt +++ b/deps/obs-scripting/obspython/CMakeLists.txt @@ -32,12 +32,8 @@ swig_add_library( target_link_libraries(obspython PRIVATE OBS::scripting OBS::libobs) -set_target_properties( - obspython - PROPERTIES - SWIG_COMPILE_DEFINITIONS - "SWIG_TYPE_TABLE=obspython;Py_ENABLE_SHARED=1;SWIG_PYTHON_INTERPRETER_NO_DEBUG" -) +list(APPEND _SWIG_DEFINITIONS "SWIG_TYPE_TABLE=obspython" "Py_ENABLE_SHARED=1" + "SWIG_PYTHON_INTERPRETER_NO_DEBUG") target_compile_features(obspython PRIVATE cxx_auto_type c_std_11) @@ -46,11 +42,15 @@ target_compile_definitions( SWIG_PYTHON_INTERPRETER_NO_DEBUG) if(ENABLE_UI) + list(APPEND _SWIG_DEFINITIONS "ENABLE_UI") target_link_libraries(obspython PRIVATE OBS::frontend-api) target_compile_definitions(obspython PRIVATE ENABLE_UI) endif() +set_target_properties(obspython PROPERTIES SWIG_COMPILE_DEFINITIONS + "${_SWIG_DEFINITIONS}") + if(OS_WINDOWS) set_target_properties( obspython