Skip to content

Commit

Permalink
Add objc-fully-link to the list of actions that require the apple_env…
Browse files Browse the repository at this point in the history
… feature. This fixes apple_static_library functionality.

PiperOrigin-RevId: 207625792
  • Loading branch information
sergiocampama authored and Copybara-Service committed Aug 6, 2018
1 parent 157b917 commit 6bd0bdf
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/test/shell/bazel/apple/bazel_apple_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -414,4 +414,30 @@ EOF
|| fail "should build apple_binary with dSYMs"
}

function test_apple_static_library() {
rm -rf package
mkdir -p package
cat > package/BUILD <<EOF
apple_static_library(
name = "static_lib",
deps = [":dummy_lib"],
platform_type = "ios",
)
objc_library(
name = "dummy_lib",
srcs = ["dummy.m"],
)
EOF
cat > "package/dummy.m" <<EOF
static int dummy __attribute__((unused,used)) = 0;
EOF

bazel build --verbose_failures //package:static_lib \
--apple_crosstool_transition \
--ios_multi_cpus=i386,x86_64 \
--ios_minimum_os=8.0 \
--xcode_version=$XCODE_VERSION \
|| fail "should build apple_static_library"
}

run_suite "apple_tests"
10 changes: 10 additions & 0 deletions tools/osx/crosstool/CROSSTOOL.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,7 @@ toolchain {
action: "objc-compile"
action: "objc++-compile"
action: "objc-archive"
action: "objc-fully-link"
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-nodeps-dynamic-library"
Expand Down Expand Up @@ -2639,6 +2640,7 @@ toolchain {
action: "objc-compile"
action: "objc++-compile"
action: "objc-archive"
action: "objc-fully-link"
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-nodeps-dynamic-library"
Expand Down Expand Up @@ -4304,6 +4306,7 @@ toolchain {
action: "objc-compile"
action: "objc++-compile"
action: "objc-archive"
action: "objc-fully-link"
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-nodeps-dynamic-library"
Expand Down Expand Up @@ -5968,6 +5971,7 @@ toolchain {
action: "objc-compile"
action: "objc++-compile"
action: "objc-archive"
action: "objc-fully-link"
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-nodeps-dynamic-library"
Expand Down Expand Up @@ -7661,6 +7665,7 @@ toolchain {
action: "objc-compile"
action: "objc++-compile"
action: "objc-archive"
action: "objc-fully-link"
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-nodeps-dynamic-library"
Expand Down Expand Up @@ -9324,6 +9329,7 @@ toolchain {
action: "objc-compile"
action: "objc++-compile"
action: "objc-archive"
action: "objc-fully-link"
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-nodeps-dynamic-library"
Expand Down Expand Up @@ -10977,6 +10983,7 @@ toolchain {
action: "objc-compile"
action: "objc++-compile"
action: "objc-archive"
action: "objc-fully-link"
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-nodeps-dynamic-library"
Expand Down Expand Up @@ -12629,6 +12636,7 @@ toolchain {
action: "objc-compile"
action: "objc++-compile"
action: "objc-archive"
action: "objc-fully-link"
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-nodeps-dynamic-library"
Expand Down Expand Up @@ -14310,6 +14318,7 @@ toolchain {
action: "objc-compile"
action: "objc++-compile"
action: "objc-archive"
action: "objc-fully-link"
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-nodeps-dynamic-library"
Expand Down Expand Up @@ -15962,6 +15971,7 @@ toolchain {
action: "objc-compile"
action: "objc++-compile"
action: "objc-archive"
action: "objc-fully-link"
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-nodeps-dynamic-library"
Expand Down

0 comments on commit 6bd0bdf

Please sign in to comment.