Add SOVERSION to libobs-opengl

Because libobs-opengl is a public library, it's customary to have SONAME
embedded in the library file.  Also remove the prefix override and
remove the prefixing "lib" from the output name.  This also requires us
to pass the library file name to dlopen invocations.
master
Carl Fürstenberg 2015-01-09 20:19:22 +01:00 committed by jp9000
parent 6d2226bde8
commit 6095e7ef51
10 changed files with 32 additions and 10 deletions

View File

@ -72,7 +72,6 @@ endif()
if(NOT INSTALLER_RUN)
add_subdirectory(deps)
add_subdirectory(libobs)
if(WIN32)
add_subdirectory(libobs-d3d11)
@ -80,6 +79,7 @@ if(NOT INSTALLER_RUN)
endif()
add_subdirectory(libobs-opengl)
add_subdirectory(libobs)
add_subdirectory(obs)
add_subdirectory(plugins)
add_subdirectory(test)

View File

@ -516,3 +516,20 @@ function(install_obs_plugin_with_data target datadir)
install_obs_plugin(${target})
install_obs_data(${target} "${datadir}" "obs-plugins/${target}")
endfunction()
function(define_graphic_modules target)
foreach(dl_lib opengl d3d9 d3d11)
string(TOUPPER ${dl_lib} dl_lib_upper)
if(TARGET libobs-${dl_lib})
target_compile_definitions(${target}
PRIVATE
DL_${dl_lib_upper}="$<TARGET_FILE_NAME:libobs-${dl_lib}>"
)
else()
target_compile_definitions(${target}
PRIVATE
DL_${dl_lib_upper}=""
)
endif()
endforeach()
endfunction()

View File

@ -1,6 +1,5 @@
project(libobs-opengl)
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR})
@ -73,8 +72,10 @@ add_library(libobs-opengl MODULE
${libobs-opengl_HEADERS})
set_target_properties(libobs-opengl
PROPERTIES
OUTPUT_NAME libobs-opengl
PREFIX "")
OUTPUT_NAME obs-opengl
VERSION 0.0
SOVERSION 0
)
target_link_libraries(libobs-opengl
libobs
glad

View File

@ -179,6 +179,8 @@ target_link_libraries(obs
Qt5::Network
${obs_PLATFORM_LIBRARIES})
define_graphic_modules(obs)
install_obs_core(obs)
install_obs_data(obs data obs-studio)

View File

@ -246,7 +246,7 @@ const char *OBSApp::GetRenderModule() const
"Renderer");
return (astrcmpi(renderer, "Direct3D 11") == 0) ?
"libobs-d3d11" : "libobs-opengl";
DL_D3D11 : DL_OPENGL;
}
bool OBSApp::OBSInit()

View File

@ -1421,13 +1421,13 @@ int OBSBasic::ResetVideo()
ret = AttemptToResetVideo(&ovi);
if (IS_WIN32 && ret != OBS_VIDEO_SUCCESS) {
/* Try OpenGL if DirectX fails on windows */
if (astrcmpi(ovi.graphics_module, "libobs-opengl") != 0) {
if (astrcmpi(ovi.graphics_module, DL_OPENGL) != 0) {
blog(LOG_WARNING, "Failed to initialize obs video (%d) "
"with graphics_module='%s', retrying "
"with graphics_module='%s'",
ret, ovi.graphics_module,
"libobs-opengl");
ovi.graphics_module = "libobs-opengl";
DL_OPENGL);
ovi.graphics_module = DL_OPENGL;
ret = AttemptToResetVideo(&ovi);
}
}

View File

@ -15,3 +15,4 @@ add_executable(osx_test
target_link_libraries(osx_test
libobs
${COCOA})
define_graphic_modules(osx_test)

View File

@ -45,7 +45,7 @@ static void CreateOBS(NSView *view)
ovi.adapter = 0;
ovi.fps_num = 30000;
ovi.fps_den = 1001;
ovi.graphics_module = "libobs-opengl";
ovi.graphics_module = DL_OPENGL;
ovi.output_format = VIDEO_FORMAT_RGBA;
ovi.base_width = cx;
ovi.base_height = cy;

View File

@ -9,3 +9,4 @@ add_executable(win-test WIN32
${win-text_SOURCES})
target_link_libraries(win-test
libobs)
define_graphic_modules(win-test)

View File

@ -80,7 +80,7 @@ static void CreateOBS(HWND hwnd)
ovi.base_height = rc.bottom;
ovi.fps_num = 30000;
ovi.fps_den = 1001;
ovi.graphics_module = "libobs-opengl";
ovi.graphics_module = DL_OPENGL;
ovi.window_width = rc.right;
ovi.window_height = rc.bottom;
ovi.output_format = VIDEO_FORMAT_RGBA;