Browse Source

cmake build fixes

Signed-off-by: falkTX <falktx@falktx.com>
pull/457/head
falkTX 5 months ago
parent
commit
57d0c51866
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 13 additions and 6 deletions
  1. +2
    -2
      CMakeLists.txt
  2. +11
    -4
      cmake/DPF-plugin.cmake

+ 2
- 2
CMakeLists.txt View File

@@ -34,11 +34,11 @@ if(DPF_LIBRARIES)
if(PKG_CONFIG_FOUND)
pkg_check_modules(CAIRO "cairo")
if(CAIRO_FOUND AND (NOT HAIKU))
dpf__add_dgl_cairo(FALSE, TRUE)
dpf__add_dgl_cairo(TRUE, TRUE)
endif()
endif()
dpf__add_dgl_external(TRUE)
dpf__add_dgl_opengl(FALSE, TRUE)
dpf__add_dgl_opengl(TRUE, TRUE)
endif()

if(DPF_EXAMPLES)


+ 11
- 4
cmake/DPF-plugin.cmake View File

@@ -136,6 +136,7 @@ function(dpf_add_plugin NAME)
dpf__add_dgl_vulkan($<NOT:$<BOOL:${_dpf_plugin_NO_SHARED_RESOURCES}>> $<BOOL:${_dpf_plugin_USE_FILE_BROWSER}>)
set(_dgl_library dgl-vulkan)
elseif(_dpf_plugin_UI_TYPE STREQUAL "webview")
set(_dpf_plugin_USE_WEB_VIEW TRUE)
dpf__add_dgl_external($<BOOL:${_dpf_plugin_USE_FILE_BROWSER}>)
set(_dgl_library dgl-external)
else()
@@ -164,7 +165,7 @@ function(dpf_add_plugin NAME)
target_compile_definitions("${NAME}" PUBLIC "DGL_USE_FILE_BROWSER")
endif()

if(_dpf_plugin_USE_WEB_VIEW OR _dpf_plugin_UI_TYPE STREQUAL "webview")
if(_dpf_plugin_USE_WEB_VIEW)
target_compile_definitions("${NAME}" PUBLIC "DGL_USE_WEB_VIEW")
endif()

@@ -192,9 +193,12 @@ function(dpf_add_plugin NAME)
target_link_libraries("${NAME}-ui" PUBLIC "${NAME}" ${_dgl_library})
if((NOT WIN32) AND (NOT APPLE) AND (NOT HAIKU))
target_link_libraries("${NAME}-ui" PRIVATE "dl")
if(_dpf_plugin_USE_WEB_VIEW)
target_link_libraries("${NAME}-ui" PRIVATE "rt")
endif()
endif()
# add the files containing Objective-C classes
dpf__add_plugin_specific_ui_sources("${NAME}-ui")
# add the files containing C++17 or Objective-C classes
dpf__add_plugin_specific_ui_sources("${NAME}-ui" $<BOOL:${_dpf_plugin_USE_WEB_VIEW}>)
else()
add_library("${NAME}-ui" INTERFACE)
endif()
@@ -981,10 +985,13 @@ endfunction()
#
# Compile system specific files, for now it is just Objective-C code
#
function(dpf__add_plugin_specific_ui_sources NAME)
function(dpf__add_plugin_specific_ui_sources NAME USE_WEB_VIEW)
if(APPLE)
target_sources("${NAME}" PRIVATE
"${DPF_ROOT_DIR}/distrho/DistrhoUI_macOS.mm")
elseif(WIN32 AND USE_WEB_VIEW)
target_sources("${NAME}" PRIVATE
"${DPF_ROOT_DIR}/distrho/DistrhoUI_win32.cpp")
endif()
endfunction()



Loading…
Cancel
Save