From e87a5c36918fda3dbede0dec4fa32550f37cad74 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Sat, 13 Apr 2024 20:06:44 +0200 Subject: [PATCH] obs-scripting: Update Linux slice for CMake build framework 3.0 --- deps/obs-scripting/CMakeLists.txt | 6 +++++- deps/obs-scripting/obs-scripting-python.c | 7 +++++++ deps/obs-scripting/obspython/CMakeLists.txt | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/deps/obs-scripting/CMakeLists.txt b/deps/obs-scripting/CMakeLists.txt index c47445028..07826e3ea 100644 --- a/deps/obs-scripting/CMakeLists.txt +++ b/deps/obs-scripting/CMakeLists.txt @@ -50,5 +50,9 @@ if(OS_WINDOWS) endif() # cmake-format: off -set_target_properties_obs(obs-scripting PROPERTIES FOLDER scripting PREFIX "") +set_target_properties_obs(obs-scripting PROPERTIES FOLDER scripting) + +if (OS_WINDOWS OR OS_MACOS) + set_property(TARGET obs-scripting PROPERTY PREFIX "") +endif() # cmake-format: on diff --git a/deps/obs-scripting/obs-scripting-python.c b/deps/obs-scripting/obs-scripting-python.c index 335eb3c86..f7a37f2d8 100644 --- a/deps/obs-scripting/obs-scripting-python.c +++ b/deps/obs-scripting/obs-scripting-python.c @@ -1750,6 +1750,13 @@ bool obs_scripting_load_python(const char *python_path) } dstr_free(&resource_path); #else + char *relative_script_path = + os_get_executable_path_ptr("../" SCRIPT_DIR); + if (relative_script_path) { + add_to_python_path(relative_script_path); + } + bfree(relative_script_path); + char *absolute_script_path = os_get_abs_path_ptr(SCRIPT_DIR); add_to_python_path(absolute_script_path); bfree(absolute_script_path); diff --git a/deps/obs-scripting/obspython/CMakeLists.txt b/deps/obs-scripting/obspython/CMakeLists.txt index 935c550bd..9d17384cc 100644 --- a/deps/obs-scripting/obspython/CMakeLists.txt +++ b/deps/obs-scripting/obspython/CMakeLists.txt @@ -43,7 +43,7 @@ target_compile_options( obspython PRIVATE $<$:/wd4100> $<$:/wd4197> - $<$:-Wno-unused-parameter> + $<$:-Wno-unused-parameter> $<$:-Wno-macro-redefined> $<$:-Wno-unreachable-code>)