mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Disable Linux support in Apple B&I builds
Swift SVN r25633
This commit is contained in:
@@ -52,6 +52,10 @@ option(SWIFT_INCLUDE_DOCS
|
||||
"Create targets for building docs."
|
||||
TRUE)
|
||||
|
||||
option(SWIFT_ENABLE_TARGET_LINUX
|
||||
"Enable compiler support for targeting Linux"
|
||||
TRUE)
|
||||
|
||||
set(SWIFT_VERSION "1.2" CACHE STRING
|
||||
"The user-visible version of the Swift compiler")
|
||||
set(SWIFT_VENDOR "" CACHE STRING
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
add_swift_library(swiftDriver
|
||||
set(swiftDriver_sources
|
||||
Action.cpp
|
||||
Compilation.cpp
|
||||
DependencyGraph.cpp
|
||||
@@ -13,5 +13,16 @@ add_swift_library(swiftDriver
|
||||
ToolChains.cpp
|
||||
Types.cpp
|
||||
Util.cpp
|
||||
)
|
||||
|
||||
add_swift_library(swiftDriver
|
||||
${swiftDriver_sources}
|
||||
DEPENDS SwiftOptions
|
||||
LINK_LIBRARIES swiftAST swiftBasic swiftFrontend swiftOption)
|
||||
|
||||
if(${SWIFT_ENABLE_TARGET_LINUX})
|
||||
foreach(f ${swiftDriver_sources})
|
||||
set_property(SOURCE ${f} APPEND_STRING PROPERTY COMPILE_FLAGS
|
||||
" -DSWIFT_ENABLE_TARGET_LINUX=\"1\"")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
@@ -1849,9 +1849,11 @@ const ToolChain *Driver::getToolChain(const ArgList &Args,
|
||||
case llvm::Triple::IOS:
|
||||
TC = new toolchains::Darwin(*this, Target);
|
||||
break;
|
||||
#if defined(SWIFT_ENABLE_TARGET_LINUX)
|
||||
case llvm::Triple::Linux:
|
||||
TC = new toolchains::Linux(*this, Target);
|
||||
break;
|
||||
#endif // SWIFT_ENABLE_TARGET_LINUX
|
||||
default:
|
||||
TC = nullptr;
|
||||
}
|
||||
|
||||
@@ -29,8 +29,12 @@ StringRef Darwin::getDarwinArchName(const ArgList &Args) const {
|
||||
return getArchName();
|
||||
}
|
||||
|
||||
#if defined(SWIFT_ENABLE_TARGET_LINUX)
|
||||
|
||||
/// Linux
|
||||
|
||||
std::unique_ptr<Tool> Linux::buildLinker() const {
|
||||
return std::unique_ptr<Tool>(new tools::linux::Linker(*this));
|
||||
}
|
||||
|
||||
#endif // SWIFT_ENABLE_TARGET_LINUX
|
||||
|
||||
@@ -34,6 +34,8 @@ public:
|
||||
StringRef getDarwinArchName(const llvm::opt::ArgList &Args) const;
|
||||
};
|
||||
|
||||
#if defined(SWIFT_ENABLE_TARGET_LINUX)
|
||||
|
||||
class LLVM_LIBRARY_VISIBILITY Linux : public ToolChain {
|
||||
protected:
|
||||
virtual std::unique_ptr<Tool> buildLinker() const;
|
||||
@@ -42,6 +44,8 @@ public:
|
||||
~Linux() = default;
|
||||
};
|
||||
|
||||
#endif // SWIFT_ENABLE_TARGET_LINUX
|
||||
|
||||
} // end namespace toolchains
|
||||
} // end namespace driver
|
||||
} // end namespace swift
|
||||
|
||||
@@ -687,6 +687,8 @@ Job *darwin::Linker::constructJob(const JobAction &JA,
|
||||
Arguments);
|
||||
}
|
||||
|
||||
#if defined(SWIFT_ENABLE_TARGET_LINUX)
|
||||
|
||||
/// Linux Tools
|
||||
|
||||
Job *linux::Linker::constructJob(const JobAction &JA,
|
||||
@@ -787,3 +789,6 @@ Job *linux::Linker::constructJob(const JobAction &JA,
|
||||
return new Job(JA, *this, std::move(Inputs), std::move(Output),
|
||||
Args.MakeArgString(Exec), Arguments);
|
||||
}
|
||||
|
||||
#endif // SWIFT_ENABLE_TARGET_LINUX
|
||||
|
||||
|
||||
Reference in New Issue
Block a user