From 94b76468ab6f43ee4c4d539619b2421c4cccb02c Mon Sep 17 00:00:00 2001 From: Helge Hess Date: Fri, 27 Apr 2018 13:34:11 +0200 Subject: [PATCH] In SPM Expat is an own module, in Xcode embedded ... hence we need to have a switch for that :-/ Maybe we should split it up in Xcode as well. --- Sources/SwiftyExpat/Expat.swift | 7 ++++++- SwiftyExpat.xcodeproj/project.pbxproj | 2 ++ SwiftyExpatTests/SwiftyExpatTests.swift | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Sources/SwiftyExpat/Expat.swift b/Sources/SwiftyExpat/Expat.swift index d6bb3f8..9317ffc 100644 --- a/Sources/SwiftyExpat/Expat.swift +++ b/Sources/SwiftyExpat/Expat.swift @@ -3,9 +3,14 @@ // SwiftyExpat // // Created by Helge Heß on 7/15/14. -// Copyright (c) 2014 Always Right Institute. All rights reserved. +// Copyright (c) 2014-2018 Always Right Institute. All rights reserved. // +#if Xcode // wasn't there an SPM flag? +#else + import Expat +#endif + /** * Simple wrapper for the Expat parser. Though the block based Expat is * reasonably easy to use as-is. diff --git a/SwiftyExpat.xcodeproj/project.pbxproj b/SwiftyExpat.xcodeproj/project.pbxproj index 7d49837..8cf1fba 100644 --- a/SwiftyExpat.xcodeproj/project.pbxproj +++ b/SwiftyExpat.xcodeproj/project.pbxproj @@ -439,6 +439,7 @@ "-D", HAVE_EXPAT_CONFIG_H, ); + OTHER_SWIFT_FLAGS = "-DXcode"; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 4.0; @@ -491,6 +492,7 @@ "-D", HAVE_EXPAT_CONFIG_H, ); + OTHER_SWIFT_FLAGS = "-DXcode"; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 4.0; diff --git a/SwiftyExpatTests/SwiftyExpatTests.swift b/SwiftyExpatTests/SwiftyExpatTests.swift index fe159a0..81c9409 100644 --- a/SwiftyExpatTests/SwiftyExpatTests.swift +++ b/SwiftyExpatTests/SwiftyExpatTests.swift @@ -9,6 +9,10 @@ import Cocoa import XCTest import SwiftyExpat +#if Xcode // wasn't there an SPM flag? +#else + import Expat +#endif class SwiftyExpatTests: XCTestCase {