From 5cd87305068c672be1ab4f1c659a32a46d26baa4 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 5 Apr 2025 01:39:28 +0200 Subject: [PATCH] Fix win32 cmake build Signed-off-by: falkTX --- cmake/DPF-plugin.cmake | 51 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/cmake/DPF-plugin.cmake b/cmake/DPF-plugin.cmake index da75f18c..713cbcb6 100644 --- a/cmake/DPF-plugin.cmake +++ b/cmake/DPF-plugin.cmake @@ -722,6 +722,14 @@ function(dpf__add_dgl_cairo SHARED_RESOURCES USE_FILE_BROWSER USE_WEB_VIEW) if(USE_WEB_VIEW) target_compile_definitions(dgl-cairo PUBLIC "DGL_USE_FILE_BROWSER") + if(WIN32) + target_sources(dgl-cairo PRIVATE + "${DPF_ROOT_DIR}/dgl/src/WebViewWin32.cpp") + set_source_files_properties("${DPF_ROOT_DIR}/dgl/src/WebViewWin32.cpp" + PROPERTIES + COMPILE_FLAGS + $,/std:c++17,-std=gnu++17>) + endif() endif() dpf__add_dgl_system_libs() @@ -786,6 +794,14 @@ function(dpf__add_dgl_external USE_FILE_BROWSER USE_WEB_VIEW) if(USE_WEB_VIEW) target_compile_definitions(dgl-external PUBLIC "DGL_USE_WEB_VIEW") + if(WIN32) + target_sources(dgl-external PRIVATE + "${DPF_ROOT_DIR}/dgl/src/WebViewWin32.cpp") + set_source_files_properties("${DPF_ROOT_DIR}/dgl/src/WebViewWin32.cpp" + PROPERTIES + COMPILE_FLAGS + $,/std:c++17,-std=gnu++17>) + endif() endif() dpf__add_dgl_system_libs() @@ -861,6 +877,14 @@ function(dpf__add_dgl_opengl SHARED_RESOURCES USE_FILE_BROWSER USE_WEB_VIEW) if(USE_WEB_VIEW) target_compile_definitions(dgl-opengl PUBLIC "DGL_USE_WEB_VIEW") + if(WIN32) + target_sources(dgl-opengl PRIVATE + "${DPF_ROOT_DIR}/dgl/src/WebViewWin32.cpp") + set_source_files_properties("${DPF_ROOT_DIR}/dgl/src/WebViewWin32.cpp" + PROPERTIES + COMPILE_FLAGS + $,/std:c++17,-std=gnu++17>) + endif() endif() dpf__add_dgl_system_libs() @@ -935,6 +959,14 @@ function(dpf__add_dgl_opengl3 SHARED_RESOURCES USE_FILE_BROWSER USE_WEB_VIEW) if(USE_WEB_VIEW) target_compile_definitions(dgl-opengl3 PUBLIC "DGL_USE_WEB_VIEW") + if(WIN32) + target_sources(dgl-opengl3 PRIVATE + "${DPF_ROOT_DIR}/dgl/src/WebViewWin32.cpp") + set_source_files_properties("${DPF_ROOT_DIR}/dgl/src/WebViewWin32.cpp" + PROPERTIES + COMPILE_FLAGS + $,/std:c++17,-std=gnu++17>) + endif() endif() dpf__add_dgl_system_libs() @@ -1004,6 +1036,14 @@ function(dpf__add_dgl_vulkan SHARED_RESOURCES USE_FILE_BROWSER USE_WEB_VIEW) if(USE_WEB_VIEW) target_compile_definitions(dgl-vulkan PUBLIC "DGL_USE_WEB_VIEW") + if(WIN32) + target_sources(dgl-vulkan PRIVATE + "${DPF_ROOT_DIR}/dgl/src/WebViewWin32.cpp") + set_source_files_properties("${DPF_ROOT_DIR}/dgl/src/WebViewWin32.cpp" + PROPERTIES + COMPILE_FLAGS + $,/std:c++17,-std=gnu++17>) + endif() endif() dpf__add_dgl_system_libs() @@ -1032,13 +1072,10 @@ function(dpf__add_plugin_specific_ui_sources NAME USE_WEB_VIEW) elseif(WIN32 AND USE_WEB_VIEW) target_sources("${NAME}" PRIVATE "${DPF_ROOT_DIR}/distrho/DistrhoUI_win32.cpp") - if (MSVC) - set_source_files_properties("${DPF_ROOT_DIR}/distrho/DistrhoUI_win32.cpp" - PROPERTIES COMPILE_FLAGS /std:c++17) - else() - set_source_files_properties("${DPF_ROOT_DIR}/distrho/DistrhoUI_win32.cpp" - PROPERTIES COMPILE_FLAGS -std=gnu++17) - endif() + set_source_files_properties("${DPF_ROOT_DIR}/distrho/DistrhoUI_win32.cpp" + PROPERTIES + COMPILE_FLAGS + $,/std:c++17,-std=gnu++17>) target_link_libraries("${NAME}" PRIVATE "ole32" "uuid") endif() endfunction()