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."
|
"Create targets for building docs."
|
||||||
TRUE)
|
TRUE)
|
||||||
|
|
||||||
|
option(SWIFT_ENABLE_TARGET_LINUX
|
||||||
|
"Enable compiler support for targeting Linux"
|
||||||
|
TRUE)
|
||||||
|
|
||||||
set(SWIFT_VERSION "1.2" CACHE STRING
|
set(SWIFT_VERSION "1.2" CACHE STRING
|
||||||
"The user-visible version of the Swift compiler")
|
"The user-visible version of the Swift compiler")
|
||||||
set(SWIFT_VENDOR "" CACHE STRING
|
set(SWIFT_VENDOR "" CACHE STRING
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
add_swift_library(swiftDriver
|
set(swiftDriver_sources
|
||||||
Action.cpp
|
Action.cpp
|
||||||
Compilation.cpp
|
Compilation.cpp
|
||||||
DependencyGraph.cpp
|
DependencyGraph.cpp
|
||||||
@@ -13,5 +13,16 @@ add_swift_library(swiftDriver
|
|||||||
ToolChains.cpp
|
ToolChains.cpp
|
||||||
Types.cpp
|
Types.cpp
|
||||||
Util.cpp
|
Util.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_swift_library(swiftDriver
|
||||||
|
${swiftDriver_sources}
|
||||||
DEPENDS SwiftOptions
|
DEPENDS SwiftOptions
|
||||||
LINK_LIBRARIES swiftAST swiftBasic swiftFrontend swiftOption)
|
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:
|
case llvm::Triple::IOS:
|
||||||
TC = new toolchains::Darwin(*this, Target);
|
TC = new toolchains::Darwin(*this, Target);
|
||||||
break;
|
break;
|
||||||
|
#if defined(SWIFT_ENABLE_TARGET_LINUX)
|
||||||
case llvm::Triple::Linux:
|
case llvm::Triple::Linux:
|
||||||
TC = new toolchains::Linux(*this, Target);
|
TC = new toolchains::Linux(*this, Target);
|
||||||
break;
|
break;
|
||||||
|
#endif // SWIFT_ENABLE_TARGET_LINUX
|
||||||
default:
|
default:
|
||||||
TC = nullptr;
|
TC = nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,12 @@ StringRef Darwin::getDarwinArchName(const ArgList &Args) const {
|
|||||||
return getArchName();
|
return getArchName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(SWIFT_ENABLE_TARGET_LINUX)
|
||||||
|
|
||||||
/// Linux
|
/// Linux
|
||||||
|
|
||||||
std::unique_ptr<Tool> Linux::buildLinker() const {
|
std::unique_ptr<Tool> Linux::buildLinker() const {
|
||||||
return std::unique_ptr<Tool>(new tools::linux::Linker(*this));
|
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;
|
StringRef getDarwinArchName(const llvm::opt::ArgList &Args) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(SWIFT_ENABLE_TARGET_LINUX)
|
||||||
|
|
||||||
class LLVM_LIBRARY_VISIBILITY Linux : public ToolChain {
|
class LLVM_LIBRARY_VISIBILITY Linux : public ToolChain {
|
||||||
protected:
|
protected:
|
||||||
virtual std::unique_ptr<Tool> buildLinker() const;
|
virtual std::unique_ptr<Tool> buildLinker() const;
|
||||||
@@ -42,6 +44,8 @@ public:
|
|||||||
~Linux() = default;
|
~Linux() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // SWIFT_ENABLE_TARGET_LINUX
|
||||||
|
|
||||||
} // end namespace toolchains
|
} // end namespace toolchains
|
||||||
} // end namespace driver
|
} // end namespace driver
|
||||||
} // end namespace swift
|
} // end namespace swift
|
||||||
|
|||||||
@@ -687,6 +687,8 @@ Job *darwin::Linker::constructJob(const JobAction &JA,
|
|||||||
Arguments);
|
Arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(SWIFT_ENABLE_TARGET_LINUX)
|
||||||
|
|
||||||
/// Linux Tools
|
/// Linux Tools
|
||||||
|
|
||||||
Job *linux::Linker::constructJob(const JobAction &JA,
|
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),
|
return new Job(JA, *this, std::move(Inputs), std::move(Output),
|
||||||
Args.MakeArgString(Exec), Arguments);
|
Args.MakeArgString(Exec), Arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // SWIFT_ENABLE_TARGET_LINUX
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user