瀏覽代碼

obs-scripting: Update Linux slice for CMake build framework 3.0

PatTheMav 1 年之前
父節點
當前提交
e87a5c3691

+ 5 - 1
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

+ 7 - 0
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);

+ 1 - 1
deps/obs-scripting/obspython/CMakeLists.txt

@@ -43,7 +43,7 @@ target_compile_options(
   obspython
   PRIVATE $<$<PLATFORM_ID:Windows>:/wd4100>
           $<$<PLATFORM_ID:Windows>:/wd4197>
-          $<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang>:-Wno-unused-parameter>
+          $<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>:-Wno-unused-parameter>
           $<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang>:-Wno-macro-redefined>
           $<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang>:-Wno-unreachable-code>)