{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift/pulls/comments/76070349","id":76070349,"diff_hunk":"@@ -418,10 +421,97 @@ function(check_working_std_regex result_var_name)\n endfunction()\n check_working_std_regex(SWIFT_HAVE_WORKING_STD_REGEX)\n \n-# If SWIFT_HOST_VARIANT_SDK not given, try to detect from the CMAKE_SYSTEM_NAME.\n-if(SWIFT_HOST_VARIANT_SDK)\n-  set(SWIFT_HOST_VARIANT_SDK_default \"${SWIFT_HOST_VARIANT_SDK}\")\n+#\n+# Enable additional warnings.\n+#\n+swift_common_cxx_warnings()\n+\n+#\n+# Configure SDKs.\n+#\n+\n+function(get_sdk_from_stdlib_target stdlib_target result_var_name)\n+  string(REPLACE \"-\" \";\" target_components \"${stdlib_target}\")\n+  list(GET target_components 0 target_sdk)\n+  \n+  # Darwin SDK names don't match their stdlib-deployment-target names\n+  if(\"${target_sdk}\" STREQUAL \"macosx\")\n+    set(target_sdk \"OSX\")\n+  elseif(\"${target_sdk}\" STREQUAL \"iphoneos\")\n+    set(target_sdk \"IOS\")\n+  elseif(\"${target_sdk}\" STREQUAL \"iphonesimulator\")\n+    set(target_sdk \"IOS_SIMULATOR\")\n+  elseif(\"${target_sdk}\" STREQUAL \"appletvos\")\n+    set(target_sdk \"TVOS\")\n+  elseif(\"${target_sdk}\" STREQUAL \"appletvsimulator\")\n+    set(target_sdk \"TVOS_SIMULATOR\")\n+  elseif(\"${target_sdk}\" STREQUAL \"watchos\")\n+    set(target_sdk \"WATCHOS\")\n+  elseif(\"${target_sdk}\" STREQUAL \"watchsimulator\")\n+    set(target_sdk \"WATCHOS_SIMULATOR\")\n+  endif()\n+\n+  string(TOUPPER \"${target_sdk}\" target_sdk)\n+  set(\"${result_var_name}\" \"${target_sdk}\" PARENT_SCOPE)\n+endfunction()\n+\n+function(get_arch_from_stdlib_target stdlib_target result_var_name)\n+  string(REPLACE \"-\" \";\" target_components \"${stdlib_target}\")\n+  list(GET target_components 1 target_arch)\n+  set(\"${result_var_name}\" \"${target_arch}\" PARENT_SCOPE)\n+endfunction()\n+\n+# Calculate the triple for an sdk/architecture.\n+# Will only return a result for supported targets.\n+function(get_triple sdk arch result_var_name)\n+  if(\"${sdk}\" STREQUAL \"LINUX\")\n+    if(\"${arch}\" STREQUAL \"x86_64\")\n+      set(triple \"x86_64-unknown-linux-gnu\")\n+    elseif(\"${arch}\" STREQUAL \"aarch64\")\n+      set(triple \"aarch64-unknown-linux-gnu\")\n+    elseif(\"${arch}\" STREQUAL \"s390x\")\n+      set(triple \"s390x-unknown-linux-gnu\")\n+    elseif(\"${arch}\" MATCHES \"(powerpc64|powerpc64le)\")\n+      set(triple \"${arch}-unknown-linux-gnu\")\n+    elseif(\"${arch}\" MATCHES \"(armv6|armv7)\")\n+      set(triple \"${arch}-unknown-linux-gnueabihf\")\n+    endif()\n+  elseif(\"${sdk}\" STREQUAL \"ANDROID\")\n+    if(\"${arch}\" STREQUAL \"armv7\")\n+      set(triple \"armv7-none-linux-androideabi\")\n+    endif()\n+  elseif(\"${sdk}\" STREQUAL \"FREEBSD\")\n+    if(\"${arch}\" STREQUAL \"x86_64\")\n+      # FIXME: Using the host OS version won't produce correct results for\n+      # cross-compilation.\n+      string(REPLACE \"[-].*\" \"\" FREEBSD_SYSTEM_VERSION ${CMAKE_SYSTEM_VERSION})\n+      message(STATUS \"FreeBSD Version: ${FREEBSD_SYSTEM_VERSION}\")\n+      set(triple \"x86_64-unknown-freebsd${FREEBSD_SYSTEM_VERSION}\")\n+    endif()\n+  elseif(\"${sdk}\" STREQUAL \"CYGWIN\")\n+    if(\"${arch}\" STREQUAL \"x86_64\")\n+      set(triple \"x86_64-unknown-windows-cygnus\")\n+    endif()\n+  #FIXME: Add Darwin sdks","path":"CMakeLists.txt","position":92,"original_position":92,"commit_id":"73c1ba264b4edfd312e83341331cc97eb12512cd","original_commit_id":"73c1ba264b4edfd312e83341331cc97eb12512cd","user":{"login":"karwa","id":5254025,"avatar_url":"https://avatars.githubusercontent.com/u/5254025?v=3","gravatar_id":"","url":"https://api.github.com/users/karwa","html_url":"https://github.com/karwa","followers_url":"https://api.github.com/users/karwa/followers","following_url":"https://api.github.com/users/karwa/following{/other_user}","gists_url":"https://api.github.com/users/karwa/gists{/gist_id}","starred_url":"https://api.github.com/users/karwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karwa/subscriptions","organizations_url":"https://api.github.com/users/karwa/orgs","repos_url":"https://api.github.com/users/karwa/repos","events_url":"https://api.github.com/users/karwa/events{/privacy}","received_events_url":"https://api.github.com/users/karwa/received_events","type":"User","site_admin":false},"body":"This PR is pretty old. There was no `WINDOWS` SDK back in June :P","created_at":"2016-08-24T14:45:23Z","updated_at":"2016-08-24T14:45:23Z","html_url":"https://github.com/apple/swift/pull/2835#discussion_r76070349","pull_request_url":"https://api.github.com/repos/apple/swift/pulls/2835","_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/comments/76070349"},"html":{"href":"https://github.com/apple/swift/pull/2835#discussion_r76070349"},"pull_request":{"href":"https://api.github.com/repos/apple/swift/pulls/2835"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/2835","id":72292249,"html_url":"https://github.com/apple/swift/pull/2835","diff_url":"https://github.com/apple/swift/pull/2835.diff","patch_url":"https://github.com/apple/swift/pull/2835.patch","issue_url":"https://api.github.com/repos/apple/swift/issues/2835","number":2835,"state":"open","locked":false,"title":"[CMake] Replace SWIFT_SDKS with SWIFT_CROSS_COMPILE_DEPLOYMENT_TARGETS","user":{"login":"karwa","id":5254025,"avatar_url":"https://avatars.githubusercontent.com/u/5254025?v=3","gravatar_id":"","url":"https://api.github.com/users/karwa","html_url":"https://github.com/karwa","followers_url":"https://api.github.com/users/karwa/followers","following_url":"https://api.github.com/users/karwa/following{/other_user}","gists_url":"https://api.github.com/users/karwa/gists{/gist_id}","starred_url":"https://api.github.com/users/karwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karwa/subscriptions","organizations_url":"https://api.github.com/users/karwa/orgs","repos_url":"https://api.github.com/users/karwa/repos","events_url":"https://api.github.com/users/karwa/events{/privacy}","received_events_url":"https://api.github.com/users/karwa/received_events","type":"User","site_admin":false},"body":"<!-- Please complete this template before creating pull request. -->\r\n#### What's in this pull request?\r\n<!-- Description about pull request. -->\r\n\r\nChange build-script(-impl) -> CMake configuration arguments to use \"deployment targets\" instead of SDK names.\r\n\r\nDeployment targets are made up of hyphen-separated lists; in the format `{sdk name}-{architecture}`, so they're the same things the build-script uses internally, save for the Apple platforms having slightly different SDK names.\r\n\r\nSince we extract the components, I'm implicitly leaving it open for us to add options to the deployment target specifier (e.g. Soft/hard float ABI) by appending them. So you might see a `linux-arm-hardfloat` deployment target in the future.\r\n\r\nWe extract the SDK name 'blindly', it's validated in the big configuration `if()...else()` on `SWIFT_HOST_VARIANT_SDK`.\r\n\r\nArchitecture is also extracted 'blindly' (sometimes there are small variations, e.g. `ppc64le` or `powerpc64le`, but the build-script handles this and always gives us valid architectures). Validation happens in `get_triple()` for all SDKs except the Apple ones, because `configure_sdk_darwin` takes a list of architectures and calculates the triples itself.\r\n\r\nThis is part 1/2 when it comes to replacing SDKs with more specific deployment targets (to allow cross-compiling linux on linux, for example). One small win already with this change is that you can configure and build single slices of the standard library for Apple platforms (since the configured architecture list is no longer hardcoded to include them all).\r\n\r\n#### Resolved bug number: ([SR-](https://bugs.swift.org/browse/SR-))\r\n<!-- If this pull request resolves any bugs from Swift bug tracker -->\r\n\r\n* * * *\r\n\r\n<!-- This selection should only be completed by Swift admin -->\r\nBefore merging this pull request to apple/swift repository:\r\n- [ ] Test pull request on Swift continuous integration.\r\n\r\n<details>\r\n  <summary>Triggering Swift CI</summary>\r\n\r\nThe swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:\r\n\r\n**Smoke Testing**\r\n\r\n        Platform     | Comment\r\n        ------------ | -------------\r\n        All supported platforms     | @swift-ci Please smoke test\r\n        All supported platforms     | @swift-ci Please smoke test and merge\r\n        OS X platform               | @swift-ci Please smoke test OS X platform\r\n        Linux platform              | @swift-ci Please smoke test Linux platform\r\n\r\n**Validation Testing**\r\n\r\n        Platform     | Comment\r\n        ------------ | -------------\r\n        All supported platforms     | @swift-ci Please test\r\n        All supported platforms     | @swift-ci Please test and merge\r\n        OS X platform               | @swift-ci Please test OS X platform\r\n        OS X platform               | @swift-ci Please benchmark\r\n        Linux platform              | @swift-ci Please test Linux platform\r\n\r\n\r\n**Lint Testing**\r\n\r\n        Language     | Comment\r\n        ------------ | -------------\r\n        Python       | @swift-ci Please Python lint\r\n\r\nNote: Only members of the Apple organization can trigger swift-ci.\r\n</details>\r\n<!-- Thank you for your contribution to Swift! -->\r\n","created_at":"2016-06-02T05:47:02Z","updated_at":"2016-08-24T14:45:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c028f22404bf1e97fd9547e03676d0c2010cf2e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift/pulls/2835/commits","review_comments_url":"https://api.github.com/repos/apple/swift/pulls/2835/comments","review_comment_url":"https://api.github.com/repos/apple/swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift/issues/2835/comments","statuses_url":"https://api.github.com/repos/apple/swift/statuses/73c1ba264b4edfd312e83341331cc97eb12512cd","head":{"label":"karwa:host-triple","ref":"host-triple","sha":"73c1ba264b4edfd312e83341331cc97eb12512cd","user":{"login":"karwa","id":5254025,"avatar_url":"https://avatars.githubusercontent.com/u/5254025?v=3","gravatar_id":"","url":"https://api.github.com/users/karwa","html_url":"https://github.com/karwa","followers_url":"https://api.github.com/users/karwa/followers","following_url":"https://api.github.com/users/karwa/following{/other_user}","gists_url":"https://api.github.com/users/karwa/gists{/gist_id}","starred_url":"https://api.github.com/users/karwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karwa/subscriptions","organizations_url":"https://api.github.com/users/karwa/orgs","repos_url":"https://api.github.com/users/karwa/repos","events_url":"https://api.github.com/users/karwa/events{/privacy}","received_events_url":"https://api.github.com/users/karwa/received_events","type":"User","site_admin":false},"repo":{"id":57429279,"name":"swift","full_name":"karwa/swift","owner":{"login":"karwa","id":5254025,"avatar_url":"https://avatars.githubusercontent.com/u/5254025?v=3","gravatar_id":"","url":"https://api.github.com/users/karwa","html_url":"https://github.com/karwa","followers_url":"https://api.github.com/users/karwa/followers","following_url":"https://api.github.com/users/karwa/following{/other_user}","gists_url":"https://api.github.com/users/karwa/gists{/gist_id}","starred_url":"https://api.github.com/users/karwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karwa/subscriptions","organizations_url":"https://api.github.com/users/karwa/orgs","repos_url":"https://api.github.com/users/karwa/repos","events_url":"https://api.github.com/users/karwa/events{/privacy}","received_events_url":"https://api.github.com/users/karwa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/karwa/swift","description":"The Swift Programming Language","fork":true,"url":"https://api.github.com/repos/karwa/swift","forks_url":"https://api.github.com/repos/karwa/swift/forks","keys_url":"https://api.github.com/repos/karwa/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/karwa/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/karwa/swift/teams","hooks_url":"https://api.github.com/repos/karwa/swift/hooks","issue_events_url":"https://api.github.com/repos/karwa/swift/issues/events{/number}","events_url":"https://api.github.com/repos/karwa/swift/events","assignees_url":"https://api.github.com/repos/karwa/swift/assignees{/user}","branches_url":"https://api.github.com/repos/karwa/swift/branches{/branch}","tags_url":"https://api.github.com/repos/karwa/swift/tags","blobs_url":"https://api.github.com/repos/karwa/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/karwa/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/karwa/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/karwa/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/karwa/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/karwa/swift/languages","stargazers_url":"https://api.github.com/repos/karwa/swift/stargazers","contributors_url":"https://api.github.com/repos/karwa/swift/contributors","subscribers_url":"https://api.github.com/repos/karwa/swift/subscribers","subscription_url":"https://api.github.com/repos/karwa/swift/subscription","commits_url":"https://api.github.com/repos/karwa/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/karwa/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/karwa/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/karwa/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/karwa/swift/contents/{+path}","compare_url":"https://api.github.com/repos/karwa/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/karwa/swift/merges","archive_url":"https://api.github.com/repos/karwa/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/karwa/swift/downloads","issues_url":"https://api.github.com/repos/karwa/swift/issues{/number}","pulls_url":"https://api.github.com/repos/karwa/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/karwa/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/karwa/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/karwa/swift/labels{/name}","releases_url":"https://api.github.com/repos/karwa/swift/releases{/id}","deployments_url":"https://api.github.com/repos/karwa/swift/deployments","created_at":"2016-04-30T05:56:30Z","updated_at":"2016-04-30T05:56:51Z","pushed_at":"2016-08-24T13:52:29Z","git_url":"git://github.com/karwa/swift.git","ssh_url":"git@github.com:karwa/swift.git","clone_url":"https://github.com/karwa/swift.git","svn_url":"https://github.com/karwa/swift","homepage":"https://swift.org/","size":115377,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apple:master","ref":"master","sha":"f727ec0cf2c7636b56f217cd340e603a5bba55b1","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":44838949,"name":"swift","full_name":"apple/swift","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","description":"The Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift","forks_url":"https://api.github.com/repos/apple/swift/forks","keys_url":"https://api.github.com/repos/apple/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift/teams","hooks_url":"https://api.github.com/repos/apple/swift/hooks","issue_events_url":"https://api.github.com/repos/apple/swift/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift/events","assignees_url":"https://api.github.com/repos/apple/swift/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift/tags","blobs_url":"https://api.github.com/repos/apple/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift/languages","stargazers_url":"https://api.github.com/repos/apple/swift/stargazers","contributors_url":"https://api.github.com/repos/apple/swift/contributors","subscribers_url":"https://api.github.com/repos/apple/swift/subscribers","subscription_url":"https://api.github.com/repos/apple/swift/subscription","commits_url":"https://api.github.com/repos/apple/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift/merges","archive_url":"https://api.github.com/repos/apple/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift/downloads","issues_url":"https://api.github.com/repos/apple/swift/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift/deployments","created_at":"2015-10-23T21:15:07Z","updated_at":"2016-08-24T14:10:25Z","pushed_at":"2016-08-24T14:26:09Z","git_url":"git://github.com/apple/swift.git","ssh_url":"git@github.com:apple/swift.git","clone_url":"https://github.com/apple/swift.git","svn_url":"https://github.com/apple/swift","homepage":"https://swift.org/","size":177500,"stargazers_count":33384,"watchers_count":33384,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4689,"mirror_url":null,"open_issues_count":79,"forks":4689,"open_issues":79,"watchers":33384,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/2835"},"html":{"href":"https://github.com/apple/swift/pull/2835"},"issue":{"href":"https://api.github.com/repos/apple/swift/issues/2835"},"comments":{"href":"https://api.github.com/repos/apple/swift/issues/2835/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift/pulls/2835/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift/pulls/2835/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift/statuses/73c1ba264b4edfd312e83341331cc97eb12512cd"}}}}
{"actor":{"display_login":"karwa"}}