{"action":"created","comment":{"url":"https://api.github.com/repos/neovim/neovim/pulls/comments/29038389","id":29038389,"diff_hunk":"@@ -1,18 +1,77 @@\n-ExternalProject_Add(libuv\n-  PREFIX ${DEPS_BUILD_DIR}\n-  URL ${LIBUV_URL}\n-  DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libuv\n-  DOWNLOAD_COMMAND ${CMAKE_COMMAND}\n-    -DPREFIX=${DEPS_BUILD_DIR}\n-    -DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libuv\n-    -DURL=${LIBUV_URL}\n-    -DEXPECTED_SHA256=${LIBUV_SHA256}\n-    -DTARGET=libuv\n-    -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake\n-  CONFIGURE_COMMAND sh ${DEPS_BUILD_DIR}/src/libuv/autogen.sh &&\n-    ${DEPS_BUILD_DIR}/src/libuv/configure --with-pic --disable-shared\n-      --prefix=${DEPS_INSTALL_DIR} --libdir=${DEPS_INSTALL_DIR}/lib\n-      CC=${DEPS_C_COMPILER}\n-  INSTALL_COMMAND ${MAKE_PRG} install)\n+# Reusable function to build libuv, the single argument is\n+# the target name. The following variables are used as build\n+# commands:\n+#   LIBUV_CONFIGURE_COMMAND\n+#   LIBUV_BUILD_COMMAND\n+#   LIBUV_INSTALL_COMMAND\n+#\n+function(BuildLibuv TARGET_NAME)\n+  ExternalProject_Add(${TARGET_NAME}\n+    PREFIX ${DEPS_BUILD_DIR}\n+    URL ${LIBUV_URL}\n+    DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libuv\n+    DOWNLOAD_COMMAND ${CMAKE_COMMAND}\n+      -DPREFIX=${DEPS_BUILD_DIR}\n+      -DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libuv\n+      -DURL=${LIBUV_URL}\n+      -DEXPECTED_SHA256=${LIBUV_SHA256}\n+      -DTARGET=${TARGET_NAME}\n+      -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake\n+    CONFIGURE_COMMAND \"${LIBUV_CONFIGURE_COMMAND}\"\n+    BUILD_COMMAND \"${LIBUV_BUILD_COMMAND}\"\n+    INSTALL_COMMAND \"${LIBUV_INSTALL_COMMAND}\")\n+endfunction()\n+\n+set(UNIX_CFGCMD sh ${DEPS_BUILD_DIR}/src/libuv/autogen.sh &&\n+      ${DEPS_BUILD_DIR}/src/libuv/configure --with-pic --disable-shared\n+        --prefix=${DEPS_INSTALL_DIR} --libdir=${DEPS_INSTALL_DIR}/lib\n+        CC=${DEPS_C_COMPILER}\n+        )\n+\n+if (UNIX)\n+  set(LIBUV_CONFIGURE_COMMAND ${UNIX_CFGCMD})\n+  set(LIBUV_BUILD_COMMAND \"\")\n+  set(LIBUV_INSTALL_COMMAND ${MAKE_PRG} install)\n+  BuildLibUv(libuv) \n+\n+elseif (MINGW AND CMAKE_CROSSCOMPILING)\n+  # Build libuv for the host\n+  set(LIBUV_CONFIGURE_COMMAND sh ${DEPS_BUILD_DIR}/src/libuv_host/autogen.sh && ${DEPS_BUILD_DIR}/src/libuv_host/configure --with-pic --disable-shared --prefix=${HOSTDEPS_INSTALL_DIR} CC=${HOST_C_COMPILER})\n+  set(LIBUV_BUILD_COMMAND \"\")\n+  set(LIBUV_INSTALL_COMMAND ${MAKE_PRG} install)\n+  BuildLibUv(libuv_host)\n+\n+  # Build libuv for the target\n+  set(LIBUV_CONFIGURE_COMMAND ${UNIX_CFGCMD} --host=${CROSS_TARGET})\n+  BuildLibUv(libuv) \n+\n+elseif (WIN32 AND MSVC)\n+ \n+  find_package(PythonInterp 2.6 REQUIRED)\n+  if (NOT PYTHONINTERP_FOUND OR PYTHON_VERSION_MAJOR GREATER 2)\n+    message(FATAL_ERROR \"Python2 is required to build libuv on windows, use -DPYTHON_EXECUTABLE to set a python interpreter\")\n+  endif()\n+\n+  string(FIND ${CMAKE_GENERATOR} Win64 VS_WIN64)\n+  if (VS_WIN64 EQUAL -1)\n+      set(VS_ARCH x86)\n+  else()\n+      set(VS_ARCH x64)\n+  endif()\n+  # FIXME: Remove this when libuv is updated (libuv/libuv#240)\n+  set(LIBUV_CONFIGURE_COMMAND git clone https://chromium.googlesource.com/external/gyp.git ${DEPS_BUILD_DIR}/src/libuv/build/gyp)\n+  # By default this creates Debug builds","path":"third-party/cmake/BuildLibuv.cmake","position":79,"original_position":79,"commit_id":"9c1586215030b24ddf78f47d529575fd59b44e64","original_commit_id":"c8508a194835583538ff4f1fcc772d7824366cfb","user":{"login":"equalsraf","id":715238,"avatar_url":"https://avatars.githubusercontent.com/u/715238?v=3","gravatar_id":"","url":"https://api.github.com/users/equalsraf","html_url":"https://github.com/equalsraf","followers_url":"https://api.github.com/users/equalsraf/followers","following_url":"https://api.github.com/users/equalsraf/following{/other_user}","gists_url":"https://api.github.com/users/equalsraf/gists{/gist_id}","starred_url":"https://api.github.com/users/equalsraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equalsraf/subscriptions","organizations_url":"https://api.github.com/users/equalsraf/orgs","repos_url":"https://api.github.com/users/equalsraf/repos","events_url":"https://api.github.com/users/equalsraf/events{/privacy}","received_events_url":"https://api.github.com/users/equalsraf/received_events","type":"User","site_admin":false},"body":"For MSVC the runtimes between all components must match i.e. I cant build a debug Neovim against a static non-debug libuv - well maybe I can but the compiler will complain. Ideally this should match the build type for the main Neovim (let me have a look at that).","created_at":"2015-04-24T10:20:20Z","updated_at":"2015-04-24T10:20:20Z","html_url":"https://github.com/neovim/neovim/pull/2495#discussion_r29038389","pull_request_url":"https://api.github.com/repos/neovim/neovim/pulls/2495","_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments/29038389"},"html":{"href":"https://github.com/neovim/neovim/pull/2495#discussion_r29038389"},"pull_request":{"href":"https://api.github.com/repos/neovim/neovim/pulls/2495"}}},"pull_request":{"url":"https://api.github.com/repos/neovim/neovim/pulls/2495","id":34011372,"html_url":"https://github.com/neovim/neovim/pull/2495","diff_url":"https://github.com/neovim/neovim/pull/2495.diff","patch_url":"https://github.com/neovim/neovim/pull/2495.patch","issue_url":"https://api.github.com/repos/neovim/neovim/issues/2495","number":2495,"state":"open","locked":false,"title":"[RFC] third-party dependencies for Windows","user":{"login":"equalsraf","id":715238,"avatar_url":"https://avatars.githubusercontent.com/u/715238?v=3","gravatar_id":"","url":"https://api.github.com/users/equalsraf","html_url":"https://github.com/equalsraf","followers_url":"https://api.github.com/users/equalsraf/followers","following_url":"https://api.github.com/users/equalsraf/following{/other_user}","gists_url":"https://api.github.com/users/equalsraf/gists{/gist_id}","starred_url":"https://api.github.com/users/equalsraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equalsraf/subscriptions","organizations_url":"https://api.github.com/users/equalsraf/orgs","repos_url":"https://api.github.com/users/equalsraf/repos","events_url":"https://api.github.com/users/equalsraf/events{/privacy}","received_events_url":"https://api.github.com/users/equalsraf/received_events","type":"User","site_admin":false},"body":"These are basically the first 4 commits in #810, and everything that relates to the third-party/ recipes for windows:\r\n\r\n- Works for MSVC and Mingw(cross compile)\r\n- Recipes for libuv, luajit, msgpack, luarocks\r\n- Busted is not building for MSVC yet (some of its deps are breaking and nvim-client needs fixing)\r\n- appveyor.yaml with settings to build in appveyor\r\n- mingw build script for Travis\r\n\r\nI'm afraid the luarocks recipe doesn't look very clean, suggestions for more idiomatic CMake are very welcome.\r\n\r\nTemporary Appveyor badge for this PR until we can setup things properly [![Build status](https://ci.appveyor.com/api/projects/status/ki4bc2v81axm36ow/branch/tb-mingw?svg=true)](https://ci.appveyor.com/project/equalsraf/neovim/branch/tb-windows-deps).\r\n","created_at":"2015-04-24T01:09:59Z","updated_at":"2015-04-24T10:20:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68abf4c0e865ba6a83b0339f72e15e694bc40546","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/neovim/neovim/pulls/2495/commits","review_comments_url":"https://api.github.com/repos/neovim/neovim/pulls/2495/comments","review_comment_url":"https://api.github.com/repos/neovim/neovim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/2495/comments","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/9c1586215030b24ddf78f47d529575fd59b44e64","head":{"label":"equalsraf:tb-windows-deps","ref":"tb-windows-deps","sha":"9c1586215030b24ddf78f47d529575fd59b44e64","user":{"login":"equalsraf","id":715238,"avatar_url":"https://avatars.githubusercontent.com/u/715238?v=3","gravatar_id":"","url":"https://api.github.com/users/equalsraf","html_url":"https://github.com/equalsraf","followers_url":"https://api.github.com/users/equalsraf/followers","following_url":"https://api.github.com/users/equalsraf/following{/other_user}","gists_url":"https://api.github.com/users/equalsraf/gists{/gist_id}","starred_url":"https://api.github.com/users/equalsraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equalsraf/subscriptions","organizations_url":"https://api.github.com/users/equalsraf/orgs","repos_url":"https://api.github.com/users/equalsraf/repos","events_url":"https://api.github.com/users/equalsraf/events{/privacy}","received_events_url":"https://api.github.com/users/equalsraf/received_events","type":"User","site_admin":false},"repo":{"id":17216430,"name":"neovim","full_name":"equalsraf/neovim","owner":{"login":"equalsraf","id":715238,"avatar_url":"https://avatars.githubusercontent.com/u/715238?v=3","gravatar_id":"","url":"https://api.github.com/users/equalsraf","html_url":"https://github.com/equalsraf","followers_url":"https://api.github.com/users/equalsraf/followers","following_url":"https://api.github.com/users/equalsraf/following{/other_user}","gists_url":"https://api.github.com/users/equalsraf/gists{/gist_id}","starred_url":"https://api.github.com/users/equalsraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equalsraf/subscriptions","organizations_url":"https://api.github.com/users/equalsraf/orgs","repos_url":"https://api.github.com/users/equalsraf/repos","events_url":"https://api.github.com/users/equalsraf/events{/privacy}","received_events_url":"https://api.github.com/users/equalsraf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/equalsraf/neovim","description":"vim's rebirth for the 21st century","fork":true,"url":"https://api.github.com/repos/equalsraf/neovim","forks_url":"https://api.github.com/repos/equalsraf/neovim/forks","keys_url":"https://api.github.com/repos/equalsraf/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/equalsraf/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/equalsraf/neovim/teams","hooks_url":"https://api.github.com/repos/equalsraf/neovim/hooks","issue_events_url":"https://api.github.com/repos/equalsraf/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/equalsraf/neovim/events","assignees_url":"https://api.github.com/repos/equalsraf/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/equalsraf/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/equalsraf/neovim/tags","blobs_url":"https://api.github.com/repos/equalsraf/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/equalsraf/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/equalsraf/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/equalsraf/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/equalsraf/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/equalsraf/neovim/languages","stargazers_url":"https://api.github.com/repos/equalsraf/neovim/stargazers","contributors_url":"https://api.github.com/repos/equalsraf/neovim/contributors","subscribers_url":"https://api.github.com/repos/equalsraf/neovim/subscribers","subscription_url":"https://api.github.com/repos/equalsraf/neovim/subscription","commits_url":"https://api.github.com/repos/equalsraf/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/equalsraf/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/equalsraf/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/equalsraf/neovim/issues/comments{/number}","contents_url":"https://api.github.com/repos/equalsraf/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/equalsraf/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/equalsraf/neovim/merges","archive_url":"https://api.github.com/repos/equalsraf/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/equalsraf/neovim/downloads","issues_url":"https://api.github.com/repos/equalsraf/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/equalsraf/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/equalsraf/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/equalsraf/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/equalsraf/neovim/labels{/name}","releases_url":"https://api.github.com/repos/equalsraf/neovim/releases{/id}","created_at":"2014-02-26T16:10:08Z","updated_at":"2015-02-11T09:46:28Z","pushed_at":"2015-04-24T10:14:22Z","git_url":"git://github.com/equalsraf/neovim.git","ssh_url":"git@github.com:equalsraf/neovim.git","clone_url":"https://github.com/equalsraf/neovim.git","svn_url":"https://github.com/equalsraf/neovim","homepage":"http://neovim.org/","size":31123,"stargazers_count":0,"watchers_count":0,"language":"VimL","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"neovim:master","ref":"master","sha":"d350d12a00518aa0d9e3a1d49c6815c3398d882f","user":{"login":"neovim","id":6471485,"avatar_url":"https://avatars.githubusercontent.com/u/6471485?v=3","gravatar_id":"","url":"https://api.github.com/users/neovim","html_url":"https://github.com/neovim","followers_url":"https://api.github.com/users/neovim/followers","following_url":"https://api.github.com/users/neovim/following{/other_user}","gists_url":"https://api.github.com/users/neovim/gists{/gist_id}","starred_url":"https://api.github.com/users/neovim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neovim/subscriptions","organizations_url":"https://api.github.com/users/neovim/orgs","repos_url":"https://api.github.com/users/neovim/repos","events_url":"https://api.github.com/users/neovim/events{/privacy}","received_events_url":"https://api.github.com/users/neovim/received_events","type":"Organization","site_admin":false},"repo":{"id":16408992,"name":"neovim","full_name":"neovim/neovim","owner":{"login":"neovim","id":6471485,"avatar_url":"https://avatars.githubusercontent.com/u/6471485?v=3","gravatar_id":"","url":"https://api.github.com/users/neovim","html_url":"https://github.com/neovim","followers_url":"https://api.github.com/users/neovim/followers","following_url":"https://api.github.com/users/neovim/following{/other_user}","gists_url":"https://api.github.com/users/neovim/gists{/gist_id}","starred_url":"https://api.github.com/users/neovim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neovim/subscriptions","organizations_url":"https://api.github.com/users/neovim/orgs","repos_url":"https://api.github.com/users/neovim/repos","events_url":"https://api.github.com/users/neovim/events{/privacy}","received_events_url":"https://api.github.com/users/neovim/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neovim/neovim","description":"ambitious Vim-fork focused on extensibility and agility. Please consider helping sustain Neovim development! https://salt.bountysource.com/teams/neovim","fork":false,"url":"https://api.github.com/repos/neovim/neovim","forks_url":"https://api.github.com/repos/neovim/neovim/forks","keys_url":"https://api.github.com/repos/neovim/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neovim/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neovim/neovim/teams","hooks_url":"https://api.github.com/repos/neovim/neovim/hooks","issue_events_url":"https://api.github.com/repos/neovim/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/neovim/neovim/events","assignees_url":"https://api.github.com/repos/neovim/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/neovim/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/neovim/neovim/tags","blobs_url":"https://api.github.com/repos/neovim/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neovim/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neovim/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/neovim/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/neovim/neovim/languages","stargazers_url":"https://api.github.com/repos/neovim/neovim/stargazers","contributors_url":"https://api.github.com/repos/neovim/neovim/contributors","subscribers_url":"https://api.github.com/repos/neovim/neovim/subscribers","subscription_url":"https://api.github.com/repos/neovim/neovim/subscription","commits_url":"https://api.github.com/repos/neovim/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/neovim/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/neovim/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/neovim/neovim/issues/comments{/number}","contents_url":"https://api.github.com/repos/neovim/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/neovim/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neovim/neovim/merges","archive_url":"https://api.github.com/repos/neovim/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neovim/neovim/downloads","issues_url":"https://api.github.com/repos/neovim/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/neovim/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/neovim/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/neovim/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neovim/neovim/labels{/name}","releases_url":"https://api.github.com/repos/neovim/neovim/releases{/id}","created_at":"2014-01-31T13:39:22Z","updated_at":"2015-04-24T09:59:06Z","pushed_at":"2015-04-24T10:14:23Z","git_url":"git://github.com/neovim/neovim.git","ssh_url":"git@github.com:neovim/neovim.git","clone_url":"https://github.com/neovim/neovim.git","svn_url":"https://github.com/neovim/neovim","homepage":"http://neovim.io","size":64591,"stargazers_count":13068,"watchers_count":13068,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":884,"mirror_url":null,"open_issues_count":449,"forks":884,"open_issues":449,"watchers":13068,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/2495"},"html":{"href":"https://github.com/neovim/neovim/pull/2495"},"issue":{"href":"https://api.github.com/repos/neovim/neovim/issues/2495"},"comments":{"href":"https://api.github.com/repos/neovim/neovim/issues/2495/comments"},"review_comments":{"href":"https://api.github.com/repos/neovim/neovim/pulls/2495/comments"},"review_comment":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neovim/neovim/pulls/2495/commits"},"statuses":{"href":"https://api.github.com/repos/neovim/neovim/statuses/9c1586215030b24ddf78f47d529575fd59b44e64"}}}}