{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift-llbuild/pulls/comments/60841991","id":60841991,"diff_hunk":"@@ -1,2 +1,83 @@\n-add_custom_target(swift-bindings\n-                  DEPENDS libllbuild)\n+# FIXME: This function should probably be in cmake/modules/Utility.cmake\n+# FIXME: Incremental builds.  \n+# Compile swift sources to swiftmodules.\n+# Usage:\n+# target          # Target name\n+# name            # Swift Module name\n+# deps            # Target dependencies\n+# sources         # List of sources\n+# additional_args # List of additional args to pass\n+function(add_swift_module target name deps sources additional_args)\n+\n+  list(APPEND ARGS -module-name)\n+  list(APPEND ARGS ${name})\n+  list(APPEND ARGS -incremental -emit-dependencies)\n+  list(APPEND ARGS -emit-module)\n+  list(APPEND ARGS -emit-module-path)\n+  list(APPEND ARGS ${name}.swiftmodule)\n+  \n+  set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})\n+  set(FILEMAP ${BUILD_DIR}/output-file-map.json)\n+  \n+  file(REMOVE ${FILEMAP})\n+  file(APPEND ${FILEMAP} \"{\\n\\\"\\\": {\\n\")\n+  file(APPEND ${FILEMAP} \"\\\"swift-dependencies\\\": \\\"${BUILD_DIR}/master.swiftdeps\\\"\\n\")\n+  file(APPEND ${FILEMAP} \"},\\n\")\n+  \n+  foreach(source ${sources})\n+    file(APPEND ${FILEMAP} \"\\\"${CMAKE_CURRENT_SOURCE_DIR}/${source}\\\": {\\n\")\n+    file(APPEND ${FILEMAP} \"\\\"dependencies\\\": \\\"${BUILD_DIR}/${source}.d\\\",\\n\")\n+    file(APPEND ${FILEMAP} \"\\\"object\\\": \\\"${BUILD_DIR}/${source}.o\\\",\\n\")\n+    file(APPEND ${FILEMAP} \"\\\"swiftmodule\\\": \\\"${BUILD_DIR}/${source}~partial.swiftmodule\\\",\\n\")\n+    file(APPEND ${FILEMAP} \"\\\"swift-dependencies\\\": \\\"${BUILD_DIR}/${source}.swiftdeps\\\"\\n}\\n\")\n+    # FIXME: add comma for all but last source.\n+  endforeach()\n+  file(APPEND ${FILEMAP} \"}\")\n+    \n+  list(APPEND ARGS -output-file-map ${BUILD_DIR}/output-file-map.json)\n+  list(APPEND ARGS -parse-as-library)\n+  list(APPEND ARGS -c)\n+\n+  foreach(source ${sources})\n+      list(APPEND ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${source})\n+  endforeach()\n+\n+  if (CMAKE_BUILD_TYPE STREQUAL \"Debug\")\n+      list(APPEND ARGS -Onone -g)\n+  else()\n+      list(APPEND ARGS -O2)\n+  endif()","path":"products/swift-bindings/CMakeLists.txt","position":51,"original_position":51,"commit_id":"38f86a84c1e7830570e22dd9572617007ec24f51","original_commit_id":"6895e9af2d683da6d69886d9cf7e9c90e68c4182","user":{"login":"aciidb0mb3r","id":4136295,"avatar_url":"https://avatars.githubusercontent.com/u/4136295?v=3","gravatar_id":"","url":"https://api.github.com/users/aciidb0mb3r","html_url":"https://github.com/aciidb0mb3r","followers_url":"https://api.github.com/users/aciidb0mb3r/followers","following_url":"https://api.github.com/users/aciidb0mb3r/following{/other_user}","gists_url":"https://api.github.com/users/aciidb0mb3r/gists{/gist_id}","starred_url":"https://api.github.com/users/aciidb0mb3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aciidb0mb3r/subscriptions","organizations_url":"https://api.github.com/users/aciidb0mb3r/orgs","repos_url":"https://api.github.com/users/aciidb0mb3r/repos","events_url":"https://api.github.com/users/aciidb0mb3r/events{/privacy}","received_events_url":"https://api.github.com/users/aciidb0mb3r/received_events","type":"User","site_admin":false},"body":"Looks like CMAKE_BUILD_TYPE can have these values \r\n```\r\nNone (CMAKE_C_FLAGS or CMAKE_CXX_FLAGS used)\r\nDebug (CMAKE_C_FLAGS_DEBUG or CMAKE_CXX_FLAGS_DEBUG)\r\nRelease (CMAKE_C_FLAGS_RELEASE or CMAKE_CXX_FLAGS_RELEASE)\r\nRelWithDebInfo (CMAKE_C_FLAGS_RELWITHDEBINFO or CMAKE_CXX_FLAGS_RELWITHDEBINFO\r\nMinSizeRel (CMAKE_C_FLAGS_MINSIZEREL or CMAKE_CXX_FLAGS_MINSIZEREL)\r\n```\r\nI couldn't something that'll tell if debug info is required, I'll handle `Debug` and `RelWithDebInfo` for now and default rest to `-O2`","created_at":"2016-04-24T09:53:37Z","updated_at":"2016-04-24T09:53:37Z","html_url":"https://github.com/apple/swift-llbuild/pull/23#discussion_r60841991","pull_request_url":"https://api.github.com/repos/apple/swift-llbuild/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/apple/swift-llbuild/pulls/comments/60841991"},"html":{"href":"https://github.com/apple/swift-llbuild/pull/23#discussion_r60841991"},"pull_request":{"href":"https://api.github.com/repos/apple/swift-llbuild/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift-llbuild/pulls/23","id":67606850,"html_url":"https://github.com/apple/swift-llbuild/pull/23","diff_url":"https://github.com/apple/swift-llbuild/pull/23.diff","patch_url":"https://github.com/apple/swift-llbuild/pull/23.patch","issue_url":"https://api.github.com/repos/apple/swift-llbuild/issues/23","number":23,"state":"open","locked":false,"title":"Swift binding integration","user":{"login":"aciidb0mb3r","id":4136295,"avatar_url":"https://avatars.githubusercontent.com/u/4136295?v=3","gravatar_id":"","url":"https://api.github.com/users/aciidb0mb3r","html_url":"https://github.com/aciidb0mb3r","followers_url":"https://api.github.com/users/aciidb0mb3r/followers","following_url":"https://api.github.com/users/aciidb0mb3r/following{/other_user}","gists_url":"https://api.github.com/users/aciidb0mb3r/gists{/gist_id}","starred_url":"https://api.github.com/users/aciidb0mb3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aciidb0mb3r/subscriptions","organizations_url":"https://api.github.com/users/aciidb0mb3r/orgs","repos_url":"https://api.github.com/users/aciidb0mb3r/repos","events_url":"https://api.github.com/users/aciidb0mb3r/events{/privacy}","received_events_url":"https://api.github.com/users/aciidb0mb3r/received_events","type":"User","site_admin":false},"body":"This PR is an attempt to get the swift bindings integrated into the build. So far It is working for OSX.\r\n\r\n* Right now I generated swiftmodule and object files for bindings and placed them under `build/products/swift-bindings/`. Should we be creating static/dynamic lib and placing it under `build/libs/`?\r\n* Bindings are written for swift 2.x, do they need to be updated for swift 3? I am guessing yes.\r\n* The swift binding compilation is using the `-incremental` flag but re running ninja always says `[1/1] Generating swiftllbuild` instead of `nothing to do`, not sure how to fix that.","created_at":"2016-04-23T13:34:06Z","updated_at":"2016-04-24T09:53:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d6c451e5d5ab00469aa1bd713dedbeb952efc1b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift-llbuild/pulls/23/commits","review_comments_url":"https://api.github.com/repos/apple/swift-llbuild/pulls/23/comments","review_comment_url":"https://api.github.com/repos/apple/swift-llbuild/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift-llbuild/issues/23/comments","statuses_url":"https://api.github.com/repos/apple/swift-llbuild/statuses/38f86a84c1e7830570e22dd9572617007ec24f51","head":{"label":"aciidb0mb3r:swift-binding","ref":"swift-binding","sha":"38f86a84c1e7830570e22dd9572617007ec24f51","user":{"login":"aciidb0mb3r","id":4136295,"avatar_url":"https://avatars.githubusercontent.com/u/4136295?v=3","gravatar_id":"","url":"https://api.github.com/users/aciidb0mb3r","html_url":"https://github.com/aciidb0mb3r","followers_url":"https://api.github.com/users/aciidb0mb3r/followers","following_url":"https://api.github.com/users/aciidb0mb3r/following{/other_user}","gists_url":"https://api.github.com/users/aciidb0mb3r/gists{/gist_id}","starred_url":"https://api.github.com/users/aciidb0mb3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aciidb0mb3r/subscriptions","organizations_url":"https://api.github.com/users/aciidb0mb3r/orgs","repos_url":"https://api.github.com/users/aciidb0mb3r/repos","events_url":"https://api.github.com/users/aciidb0mb3r/events{/privacy}","received_events_url":"https://api.github.com/users/aciidb0mb3r/received_events","type":"User","site_admin":false},"repo":{"id":52672662,"name":"swift-llbuild","full_name":"aciidb0mb3r/swift-llbuild","owner":{"login":"aciidb0mb3r","id":4136295,"avatar_url":"https://avatars.githubusercontent.com/u/4136295?v=3","gravatar_id":"","url":"https://api.github.com/users/aciidb0mb3r","html_url":"https://github.com/aciidb0mb3r","followers_url":"https://api.github.com/users/aciidb0mb3r/followers","following_url":"https://api.github.com/users/aciidb0mb3r/following{/other_user}","gists_url":"https://api.github.com/users/aciidb0mb3r/gists{/gist_id}","starred_url":"https://api.github.com/users/aciidb0mb3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aciidb0mb3r/subscriptions","organizations_url":"https://api.github.com/users/aciidb0mb3r/orgs","repos_url":"https://api.github.com/users/aciidb0mb3r/repos","events_url":"https://api.github.com/users/aciidb0mb3r/events{/privacy}","received_events_url":"https://api.github.com/users/aciidb0mb3r/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aciidb0mb3r/swift-llbuild","description":"A low-level build system, used by the Swift Package Manager","fork":true,"url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild","forks_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/forks","keys_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/teams","hooks_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/hooks","issue_events_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/issues/events{/number}","events_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/events","assignees_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/assignees{/user}","branches_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/branches{/branch}","tags_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/tags","blobs_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/git/refs{/sha}","trees_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/statuses/{sha}","languages_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/languages","stargazers_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/stargazers","contributors_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/contributors","subscribers_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/subscribers","subscription_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/subscription","commits_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/commits{/sha}","git_commits_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/git/commits{/sha}","comments_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/comments{/number}","issue_comment_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/issues/comments{/number}","contents_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/contents/{+path}","compare_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/merges","archive_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/downloads","issues_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/issues{/number}","pulls_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/pulls{/number}","milestones_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/milestones{/number}","notifications_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/labels{/name}","releases_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/releases{/id}","deployments_url":"https://api.github.com/repos/aciidb0mb3r/swift-llbuild/deployments","created_at":"2016-02-27T15:16:27Z","updated_at":"2016-02-27T15:16:29Z","pushed_at":"2016-04-24T06:39:21Z","git_url":"git://github.com/aciidb0mb3r/swift-llbuild.git","ssh_url":"git@github.com:aciidb0mb3r/swift-llbuild.git","clone_url":"https://github.com/aciidb0mb3r/swift-llbuild.git","svn_url":"https://github.com/aciidb0mb3r/swift-llbuild","homepage":"","size":6913,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apple:master","ref":"master","sha":"aa71a44afe02cc44c4bfa50e8c4fb8ea729e6d4a","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44838988,"name":"swift-llbuild","full_name":"apple/swift-llbuild","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift-llbuild","description":"A low-level build system, used by the Swift Package Manager","fork":false,"url":"https://api.github.com/repos/apple/swift-llbuild","forks_url":"https://api.github.com/repos/apple/swift-llbuild/forks","keys_url":"https://api.github.com/repos/apple/swift-llbuild/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift-llbuild/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift-llbuild/teams","hooks_url":"https://api.github.com/repos/apple/swift-llbuild/hooks","issue_events_url":"https://api.github.com/repos/apple/swift-llbuild/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift-llbuild/events","assignees_url":"https://api.github.com/repos/apple/swift-llbuild/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift-llbuild/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift-llbuild/tags","blobs_url":"https://api.github.com/repos/apple/swift-llbuild/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift-llbuild/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift-llbuild/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift-llbuild/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift-llbuild/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift-llbuild/languages","stargazers_url":"https://api.github.com/repos/apple/swift-llbuild/stargazers","contributors_url":"https://api.github.com/repos/apple/swift-llbuild/contributors","subscribers_url":"https://api.github.com/repos/apple/swift-llbuild/subscribers","subscription_url":"https://api.github.com/repos/apple/swift-llbuild/subscription","commits_url":"https://api.github.com/repos/apple/swift-llbuild/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift-llbuild/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift-llbuild/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift-llbuild/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift-llbuild/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift-llbuild/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift-llbuild/merges","archive_url":"https://api.github.com/repos/apple/swift-llbuild/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift-llbuild/downloads","issues_url":"https://api.github.com/repos/apple/swift-llbuild/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift-llbuild/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift-llbuild/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift-llbuild/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift-llbuild/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift-llbuild/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift-llbuild/deployments","created_at":"2015-10-23T21:15:45Z","updated_at":"2016-04-22T03:51:27Z","pushed_at":"2016-04-24T06:36:32Z","git_url":"git://github.com/apple/swift-llbuild.git","ssh_url":"git@github.com:apple/swift-llbuild.git","clone_url":"https://github.com/apple/swift-llbuild.git","svn_url":"https://github.com/apple/swift-llbuild","homepage":"","size":6923,"stargazers_count":289,"watchers_count":289,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":49,"mirror_url":null,"open_issues_count":3,"forks":49,"open_issues":3,"watchers":289,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift-llbuild/pulls/23"},"html":{"href":"https://github.com/apple/swift-llbuild/pull/23"},"issue":{"href":"https://api.github.com/repos/apple/swift-llbuild/issues/23"},"comments":{"href":"https://api.github.com/repos/apple/swift-llbuild/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift-llbuild/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift-llbuild/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift-llbuild/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift-llbuild/statuses/38f86a84c1e7830570e22dd9572617007ec24f51"}}}}