Created by: robbertvanginkel
The dependency flags passed to SwiftCompile by the AppleLibraryDescriptionSwiftEnhancer
currently only include "include" flags. This is not sufficient as some rules export frameworks as part of the rule, and the framework search paths for those need to be visible to use the framework.
This change adds the FrameworkPaths to the PreprocessorFlags that are passed when creating the swiftcompile rule. Those are included in the compile command in getSwiftIncludeArgs
, but unfortunately this prefixes them with -Xcc
to only make them visible to the clang importer. The frameworks search paths need to be seen visible to both the clang and swift compiler, which is why the paths are also added without -Xcc
. This duplication is unfortunate but does not cause problems.