diff options
author | 2018-07-10 09:57:06 -0700 | |
---|---|---|
committer | 2018-07-10 09:58:35 -0700 | |
commit | 4a11a0207b416299e76b9c6cba740939b74c0e6b (patch) | |
tree | 92b88850f156683d06d86abb81a453802aabc3f6 /src/main/java/com/google/devtools/build/lib/skylarkbuildapi | |
parent | ccd7d76aff2bd41eaf23f9b182f41feffbcfea1e (diff) |
C++: Exposes new parameters of C++ Skylark API.
This will be needed by py_wrap_cc in a follow up CL.
RELNOTES:none
PiperOrigin-RevId: 203964457
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skylarkbuildapi')
4 files changed, 52 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcLinkingOutputsApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcLinkingOutputsApi.java new file mode 100644 index 0000000000..93d81e5af6 --- /dev/null +++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcLinkingOutputsApi.java @@ -0,0 +1,37 @@ +// Copyright 2018 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.devtools.build.lib.skylarkbuildapi.cpp; + +import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable; +import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; +import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory; +import com.google.devtools.build.lib.syntax.SkylarkList; + +/** Interface for a structured representation of the linking outputs of a C++ rule. */ +@SkylarkModule( + name = "CcLinkingOutputs", + category = SkylarkModuleCategory.BUILTIN, + documented = false, + doc = "Helper class containing CC compilation outputs.") +public interface CcLinkingOutputsApi { + @SkylarkCallable(name = "dynamic_libraries_for_linking", documented = false) + SkylarkList<LibraryToLinkApi> getSkylarkDynamicLibrariesForLinking(); + + @SkylarkCallable(name = "static_libraries", documented = false) + SkylarkList<LibraryToLinkApi> getSkylarkStaticLibraries(); + + @SkylarkCallable(name = "pic_static_libraries", documented = false) + SkylarkList<LibraryToLinkApi> getSkylarkPicStaticLibraries(); +} diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/LibraryToLinkApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/LibraryToLinkApi.java index a8421654c7..ff3b6214d0 100644 --- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/LibraryToLinkApi.java +++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/LibraryToLinkApi.java @@ -26,4 +26,4 @@ import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory; category = SkylarkModuleCategory.BUILTIN, documented = false, doc = "A library the user can link to.") -public interface LibraryToLinkApi {} +public interface LibraryToLinkApi extends LinkerInputApi {} diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/LinkerInputApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/LinkerInputApi.java index 13707d21e6..3d33a7eb8a 100644 --- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/LinkerInputApi.java +++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/LinkerInputApi.java @@ -16,14 +16,24 @@ package com.google.devtools.build.lib.skylarkbuildapi.cpp; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable; +import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; +import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory; /** * Something that appears on the command line of the linker. Since we sometimes expand archive files * to their constituent object files, we need to keep information whether a certain file contains * embedded objects and if so, the list of the object files themselves. */ +@SkylarkModule( + name = "LinkerInputApi", + category = SkylarkModuleCategory.BUILTIN, + documented = false, + doc = "An input that appears in the command line of the linker.") public interface LinkerInputApi { /** Returns the artifact that is the input of the linker. */ @SkylarkCallable(name = "artifact", doc = "Artifact passed to the linker.") Artifact getArtifact(); + + @SkylarkCallable(name = "original_artifact", doc = "Artifact passed to the linker.") + Artifact getOriginalLibraryArtifact(); } diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/LinkingInfoApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/LinkingInfoApi.java index d572708906..6b72b92ede 100644 --- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/LinkingInfoApi.java +++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/LinkingInfoApi.java @@ -30,5 +30,8 @@ import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory; public interface LinkingInfoApi { @SkylarkCallable(name = "cc_linking_info", documented = false) - public CcLinkingInfoApi getCcLinkingInfo(); + CcLinkingInfoApi getCcLinkingInfo(); + + @SkylarkCallable(name = "cc_linking_outputs", documented = false) + CcLinkingOutputsApi getCcLinkingOutputs(); } |