Skip to content

Commit

Permalink
Fix webview msvc build
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed May 17, 2024
1 parent 3d70898 commit 30e2d32
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
9 changes: 7 additions & 2 deletions cmake/DPF-plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -996,8 +996,13 @@ 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")
set_source_files_properties("${DPF_ROOT_DIR}/distrho/DistrhoUI_win32.cpp"
PROPERTIES COMPILE_FLAGS -std=gnu++17)
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()
endif()
endfunction()

Expand Down
20 changes: 10 additions & 10 deletions distrho/extra/WebViewWin32.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ START_NAMESPACE_DISTRHO

struct WebView;

WebView* webview_choc_create(const WebViewOptions& opts);
void webview_choc_destroy(WebView*);
void* webview_choc_handle(WebView*);
void webview_choc_eval(WebView*, const char* js);
void webview_choc_navigate(WebView*, const char* url);
WebView* __cdecl webview_choc_create(const WebViewOptions& opts);
void __cdecl webview_choc_destroy(WebView*);
void* __cdecl webview_choc_handle(WebView*);
void __cdecl webview_choc_eval(WebView*, const char* js);
void __cdecl webview_choc_navigate(WebView*, const char* url);

END_NAMESPACE_DISTRHO

Expand All @@ -43,7 +43,7 @@ END_NAMESPACE_DISTRHO

START_NAMESPACE_DISTRHO

WebView* webview_choc_create(const WebViewOptions& opts)
WebView* __cdecl webview_choc_create(const WebViewOptions& opts)
{
WebView::Options wopts;
wopts.acceptsFirstMouseClick = true;
Expand Down Expand Up @@ -74,22 +74,22 @@ WebView* webview_choc_create(const WebViewOptions& opts)
return webview.release();
}

void webview_choc_destroy(WebView* const webview)
void __cdecl webview_choc_destroy(WebView* const webview)
{
delete webview;
}

void* webview_choc_handle(WebView* const webview)
void* __cdecl webview_choc_handle(WebView* const webview)
{
return webview->getViewHandle();
}

void webview_choc_eval(WebView* const webview, const char* const js)
void __cdecl webview_choc_eval(WebView* const webview, const char* const js)
{
webview->evaluateJavascript(js);
}

void webview_choc_navigate(WebView* const webview, const char* const url)
void __cdecl webview_choc_navigate(WebView* const webview, const char* const url)
{
webview->navigate(url);
}
Expand Down

0 comments on commit 30e2d32

Please sign in to comment.