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.
master
PatTheMav 2022-05-28 18:22:53 +02:00 committed by Jim
parent 893d3ce218
commit 29759ef8fb
1 changed files with 6 additions and 6 deletions

View File

@ -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