From 0fbf936b4630ca9db0d492d8c7e583f45d959b45 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 21 May 2019 08:32:33 -0700 Subject: Modules: remove `CMAKE_INCLUDE_FLAG_SEP_Swift` The include flag specifier should be specified multiply. The separator was being misused for adding a space after the `-I` flag. Correct this to get multiple include paths correct. --- Modules/CMakeSwiftInformation.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 64e7f99..aa5f260 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -17,8 +17,7 @@ if(CMAKE_Swift_COMPILER_ID) include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift OPTIONAL) endif() -set(CMAKE_INCLUDE_FLAG_Swift "-I") -set(CMAKE_INCLUDE_FLAG_SEP_Swift " ") +set(CMAKE_INCLUDE_FLAG_Swift "-I ") set(CMAKE_Swift_DEFINE_FLAG -D) set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ") set(CMAKE_Swift_COMPILER_ARG1 -frontend) -- cgit v0.12 From 7e636fd8e0f10c8e0ba5eea529f4fedffd899ecf Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 21 May 2019 08:34:00 -0700 Subject: Modules: add `CMAKE_Swift_FRAMEWORK_SEARCH_FLAG` Swift supports frameworks and uses them across all OSes. They are added using the `-F` flag. There must be a space following the flag and before the parameter. --- Modules/CMakeSwiftInformation.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index aa5f260..15b0a1a 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -21,6 +21,7 @@ set(CMAKE_INCLUDE_FLAG_Swift "-I ") set(CMAKE_Swift_DEFINE_FLAG -D) set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ") set(CMAKE_Swift_COMPILER_ARG1 -frontend) +set(CMAKE_Swift_FRAMEWORK_SEARCH_FLAG "-F ") set(CMAKE_Swift_FLAGS_DEBUG_INIT "-g") set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O") -- cgit v0.12 From 24223ac84bd1610cef2ab0935233387227653dfd Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 21 May 2019 08:36:54 -0700 Subject: Modules: add Swift MSVC_RUNTIME_LIBRARY flags This adds support for the newly minted `-libc` flag to the Swift driver invocation. These allow users to control the MSVC linkage properly on Windows targets. --- Modules/CMakeSwiftInformation.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 15b0a1a..8ec4891 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -23,6 +23,14 @@ set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ") set(CMAKE_Swift_COMPILER_ARG1 -frontend) set(CMAKE_Swift_FRAMEWORK_SEARCH_FLAG "-F ") +# NOTE(compnerd) use the short form for convenience and ease of search. They +# are treated equivalent to their long form names as well as custom Swift +# specific names. +set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded -libc MT) +set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -libc MD) +set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -libc MTd) +set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -libc MDd) + set(CMAKE_Swift_FLAGS_DEBUG_INIT "-g") set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O") set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g") -- cgit v0.12