diff --git a/CMakeLists.txt b/CMakeLists.txt index 119440982..e24a9882e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,13 @@ set(SOURCE_FILES src/civetweb/civetweb.c src/webui.c ) + +if (WIN32) + set(SOURCE_FILES ${SOURCE_FILES} + src/webview/win32_wv2.cpp + ) +endif() + if (APPLE) # enable macos webview enable_language(OBJC) @@ -63,6 +70,14 @@ endif() if (WIN32) target_link_libraries(webui PRIVATE ws2_32 user32 shell32 ole32) + + if ("${CMAKE_CXX_COMPILER}" STREQUAL "GNU") + message("Adding stdc++ as library") + target_link_libraries(webui stdc++) + else() + message("Not a windows GNU target") + endif() + elseif (APPLE) # link required frameworks find_library(COCOA_FRAMEWORK Cocoa REQUIRED) @@ -118,4 +133,4 @@ if (WEBUI_BUILD_EXAMPLES) if (MSVC) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT call_js_from_cpp) endif() -endif() \ No newline at end of file +endif()