mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-24 02:34:23 -05:00
cmake: Fix frontend feature flag mismatch
The actual frontend provided an "ENABLE_FRONTEND" build flag, whereas the global project still provided an "ENABLE_UI" flag, which itself was only read and respected by the scripting module. This change retains the global flag and makes both the actual frontend as well as the scripting module respect its value.
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ include(compilerconfig)
|
||||
include(defaults)
|
||||
include(helpers)
|
||||
|
||||
option(ENABLE_UI "Enable building with UI (requires Qt)" ON)
|
||||
option(ENABLE_FRONTEND "Enable building with UI (requires Qt)" ON)
|
||||
option(ENABLE_SCRIPTING "Enable scripting support" ON)
|
||||
option(ENABLE_HEVC "Enable HEVC encoders" ON)
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.28...3.30)
|
||||
|
||||
add_subdirectory(api)
|
||||
|
||||
option(ENABLE_FRONTEND "Enable building with UI frontend (requires Qt6)" ON)
|
||||
|
||||
if(NOT ENABLE_FRONTEND)
|
||||
target_disable_feature(obs "User Interface")
|
||||
return()
|
||||
|
||||
@@ -30,7 +30,7 @@ target_sources(
|
||||
|
||||
target_compile_definitions(
|
||||
obs-scripting
|
||||
PRIVATE SCRIPT_DIR="${OBS_SCRIPT_PLUGIN_PATH}" $<$<BOOL:${ENABLE_UI}>:ENABLE_UI>
|
||||
PRIVATE SCRIPT_DIR="${OBS_SCRIPT_PLUGIN_PATH}" $<$<BOOL:${ENABLE_FRONTEND}>:ENABLE_FRONTEND>
|
||||
)
|
||||
|
||||
target_include_directories(obs-scripting PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
@@ -40,7 +40,7 @@ target_link_libraries(
|
||||
PRIVATE
|
||||
OBS::libobs
|
||||
OBS::cstrcache
|
||||
$<$<BOOL:${ENABLE_UI}>:OBS::frontend-api>
|
||||
$<$<BOOL:${ENABLE_FRONTEND}>:OBS::frontend-api>
|
||||
$<$<PLATFORM_ID:Windows>:OBS::w32-pthreads>
|
||||
$<$<PLATFORM_ID:Darwin>:objc>
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ if(ENABLE_SCRIPTING_LUA)
|
||||
target_sources(
|
||||
obs-scripting
|
||||
PRIVATE
|
||||
$<$<BOOL:${ENABLE_UI}>:obs-scripting-lua-frontend.c>
|
||||
$<$<BOOL:${ENABLE_FRONTEND}>:obs-scripting-lua-frontend.c>
|
||||
obs-scripting-lua-source.c
|
||||
obs-scripting-lua.c
|
||||
obs-scripting-lua.h
|
||||
|
||||
@@ -27,7 +27,7 @@ if(ENABLE_SCRIPTING_PYTHON)
|
||||
target_sources(
|
||||
obs-scripting
|
||||
PRIVATE
|
||||
$<$<BOOL:${ENABLE_UI}>:obs-scripting-python-frontend.c>
|
||||
$<$<BOOL:${ENABLE_FRONTEND}>:obs-scripting-python-frontend.c>
|
||||
$<$<PLATFORM_ID:Windows,Darwin>:obs-scripting-python-import.c>
|
||||
obs-scripting-python-import.h
|
||||
obs-scripting-python.c
|
||||
|
||||
@@ -26,4 +26,4 @@
|
||||
#define SCRIPT_DIR "@OBS_SCRIPT_PLUGIN_PATH@"
|
||||
#define PYTHON_LIB "@OBS_SCRIPT_PYTHON_PATH@"
|
||||
|
||||
#define UI_ENABLED @ENABLE_UI@
|
||||
#define UI_ENABLED @ENABLE_FRONTEND@
|
||||
|
||||
@@ -72,7 +72,7 @@ static void add_hook_functions(lua_State *script);
|
||||
static int obs_lua_remove_tick_callback(lua_State *script);
|
||||
static int obs_lua_remove_main_render_callback(lua_State *script);
|
||||
|
||||
#ifdef ENABLE_UI
|
||||
#ifdef ENABLE_FRONTEND
|
||||
void add_lua_frontend_funcs(lua_State *script);
|
||||
#endif
|
||||
|
||||
@@ -112,7 +112,7 @@ static bool load_lua_script(struct obs_lua_script *data)
|
||||
|
||||
add_lua_source_functions(script);
|
||||
add_hook_functions(script);
|
||||
#ifdef ENABLE_UI
|
||||
#ifdef ENABLE_FRONTEND
|
||||
add_lua_frontend_funcs(script);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -33,12 +33,12 @@ target_compile_options(
|
||||
|
||||
target_compile_definitions(
|
||||
obslua
|
||||
PRIVATE SWIG_TYPE_TABLE=obslua SWIG_LUA_INTERPRETER_NO_DEBUG $<$<BOOL:${ENABLE_UI}>:ENABLE_UI>
|
||||
PRIVATE SWIG_TYPE_TABLE=obslua SWIG_LUA_INTERPRETER_NO_DEBUG $<$<BOOL:${ENABLE_FRONTEND}>:ENABLE_FRONTEND>
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
obslua
|
||||
PRIVATE OBS::cstrcache OBS::libobs OBS::scripting Luajit::Luajit $<$<BOOL:${ENABLE_UI}>:OBS::frontend-api>
|
||||
PRIVATE OBS::cstrcache OBS::libobs OBS::scripting Luajit::Luajit $<$<BOOL:${ENABLE_FRONTEND}>:OBS::frontend-api>
|
||||
)
|
||||
|
||||
set_property(
|
||||
@@ -48,7 +48,7 @@ set_property(
|
||||
SWIG_COMPILE_DEFINITIONS
|
||||
"SWIG_TYPE_TABLE=obslua"
|
||||
"SWIG_LUA_INTERPRETER_NO_DEBUG"
|
||||
"$<$<BOOL:${ENABLE_UI}>:ENABLE_UI>"
|
||||
"$<$<BOOL:${ENABLE_FRONTEND}>:ENABLE_FRONTEND>"
|
||||
)
|
||||
|
||||
set_target_properties_obs(obslua PROPERTIES FOLDER scripting XCODE_ATTRIBUTE_STRIP_STYLE non-global)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <util/platform.h>
|
||||
#include <util/config-file.h>
|
||||
|
||||
#if defined(ENABLE_UI)
|
||||
#if defined(ENABLE_FRONTEND)
|
||||
#include "obs-frontend-api.h"
|
||||
#endif
|
||||
|
||||
@@ -106,6 +106,6 @@ static inline void wrap_blog(int log_level, const char *message)
|
||||
%include "util/platform.h"
|
||||
%include "util/config-file.h"
|
||||
|
||||
#if defined(ENABLE_UI)
|
||||
#if defined(ENABLE_FRONTEND)
|
||||
%include "obs-frontend-api.h"
|
||||
#endif
|
||||
|
||||
@@ -58,7 +58,7 @@ target_compile_definitions(
|
||||
SWIG_TYPE_TABLE=obspython
|
||||
Py_ENABLE_SHARED=1
|
||||
SWIG_PYTHON_INTERPRETER_NO_DEBUG
|
||||
$<$<BOOL:${ENABLE_UI}>:ENABLE_UI>
|
||||
$<$<BOOL:${ENABLE_FRONTEND}>:ENABLE_FRONTEND>
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
@@ -67,7 +67,7 @@ target_link_libraries(
|
||||
OBS::cstrcache
|
||||
OBS::libobs
|
||||
OBS::scripting
|
||||
$<$<BOOL:${ENABLE_UI}>:OBS::frontend-api>
|
||||
$<$<BOOL:${ENABLE_FRONTEND}>:OBS::frontend-api>
|
||||
$<$<NOT:$<PLATFORM_ID:Darwin>>:Python::Python>
|
||||
)
|
||||
|
||||
@@ -92,7 +92,7 @@ set_property(
|
||||
"SWIG_TYPE_TABLE=obspython"
|
||||
"Py_ENABLE_SHARED=1"
|
||||
"SWIG_PYTHON_INTERPRETER_NO_DEBUG"
|
||||
"$<$<BOOL:${ENABLE_UI}>:ENABLE_UI>"
|
||||
"$<$<BOOL:${ENABLE_FRONTEND}>:ENABLE_FRONTEND>"
|
||||
"$<$<PLATFORM_ID:Windows>:MS_NO_COREDLL>"
|
||||
)
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <util/platform.h>
|
||||
#include <util/config-file.h>
|
||||
|
||||
#if defined(ENABLE_UI)
|
||||
#if defined(ENABLE_FRONTEND)
|
||||
#include "obs-frontend-api.h"
|
||||
#endif
|
||||
|
||||
@@ -128,7 +128,7 @@ static inline void wrap_blog(int log_level, const char *message)
|
||||
%include "util/platform.h"
|
||||
%include "util/config-file.h"
|
||||
|
||||
#if defined(ENABLE_UI)
|
||||
#if defined(ENABLE_FRONTEND)
|
||||
%include "obs-frontend-api.h"
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user