Skip to content

[cmake] Allow cross-compilation of add_swift_executable targets. #2363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ endif()
add_swift_executable(plutil
SOURCES
Tools/plutil/main.swift
TARGET
${CMAKE_C_COMPILER_TARGET}
CFLAGS
-F${CMAKE_CURRENT_BINARY_DIR}
LINK_FLAGS
Expand All @@ -409,6 +411,8 @@ add_swift_executable(plutil

if(ENABLE_TESTING)
add_swift_executable(xdgTestHelper
TARGET
${CMAKE_C_COMPILER_TARGET}
CFLAGS
-F${CMAKE_CURRENT_BINARY_DIR}
LINK_FLAGS
Expand Down Expand Up @@ -528,6 +532,8 @@ if(ENABLE_TESTING)
TestFoundation/TestUUID.swift
TestFoundation/TestXMLDocument.swift
TestFoundation/TestXMLParser.swift
TARGET
${CMAKE_C_COMPILER_TARGET}
CFLAGS
-F${CMAKE_CURRENT_BINARY_DIR}
LINK_FLAGS
Expand Down
6 changes: 3 additions & 3 deletions Tools/plutil/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
#if os(macOS) || os(iOS)
#if canImport(Darwin)
import Darwin
import SwiftFoundation
#elseif os(Linux)
#elseif canImport(Glibc)
import Foundation
import Glibc
#elseif os(Windows)
#elseif canImport(MSVCRT)
import Foundation
import MSVCRT
#endif
Expand Down