From 0e3c01252e89e15183bf3d8502b658f57404dbb5 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Tue, 31 Dec 2019 01:30:37 -0800 Subject: [PATCH] Fix building on Windows using MinGW (#15405) --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f49e5f9622..32f26c3024 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,12 @@ include_directories(src/linenoise/src) include_directories(src/mongoose) include_directories(src/qcommandline) -set(EXTRA_LIBS dl) +if (WIN32) + set(EXTRA_LIBS ws2_32) + add_definitions(-DQCOMMANDLINE_STATIC) +else() + set(EXTRA_LIBS dl) +endif() add_executable(${PROJECT_NAME} src/phantomjs.qrc ${PHANTOMJS_SOURCES} ${THIRDPARTY_SOURCES}) target_link_libraries(${PROJECT_NAME} ${EXTRA_LIBS} Qt5::Core Qt5::Network Qt5::WebKitWidgets Threads::Threads)