Geoffrey Martin-Noble | 552d3f8 | 2021-05-25 17:56:09 -0700 | [diff] [blame] | 1 | # Copyright 2020 The IREE Authors |
Scott Todd | 69655bc | 2020-11-30 16:28:52 -0800 | [diff] [blame] | 2 | # |
Geoffrey Martin-Noble | 552d3f8 | 2021-05-25 17:56:09 -0700 | [diff] [blame] | 3 | # Licensed under the Apache License v2.0 with LLVM Exceptions. |
| 4 | # See https://llvm.org/LICENSE.txt for license information. |
| 5 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Scott Todd | 69655bc | 2020-11-30 16:28:52 -0800 | [diff] [blame] | 6 | |
| 7 | package( |
| 8 | default_visibility = ["//visibility:public"], |
| 9 | features = ["layering_check"], |
| 10 | licenses = ["notice"], # Apache 2.0 |
| 11 | ) |
| 12 | |
| 13 | # Helper for getting linkopts into libraries in a way we can easily spot and |
| 14 | # rewrite from bazel-to-cmake and copybara. |
| 15 | cc_library( |
| 16 | name = "default_linkopts", |
| 17 | linkopts = select({ |
Scott Todd | e32cc76 | 2022-05-23 12:07:34 -0700 | [diff] [blame] | 18 | "//build_tools/bazel:iree_is_msvc": [], |
| 19 | "//build_tools/bazel:iree_is_android": [ |
Copybara-Service | 7306180 | 2020-12-02 17:13:07 -0800 | [diff] [blame] | 20 | # Android provides its own pthreads support with no linking required. |
| 21 | ], |
Scott Todd | 69655bc | 2020-11-30 16:28:52 -0800 | [diff] [blame] | 22 | "//conditions:default": [ |
| 23 | # Just include libraries that should be presumed in 2020. |
Scott Todd | 69655bc | 2020-11-30 16:28:52 -0800 | [diff] [blame] | 24 | "-lpthread", |
| 25 | ], |
| 26 | }), |
| 27 | ) |
Marius Kintel | 79cf154 | 2021-06-22 13:46:21 -0400 | [diff] [blame] | 28 | |
| 29 | cc_library( |
| 30 | name = "dl", |
| 31 | linkopts = select({ |
Scott Todd | e32cc76 | 2022-05-23 12:07:34 -0700 | [diff] [blame] | 32 | "//build_tools/bazel:iree_is_msvc": [], |
| 33 | "//build_tools/bazel:iree_is_android": [ |
Marius Kintel | 79cf154 | 2021-06-22 13:46:21 -0400 | [diff] [blame] | 34 | "-ldl", |
| 35 | ], |
| 36 | "//conditions:default": [ |
| 37 | "-ldl", |
| 38 | ], |
| 39 | }), |
| 40 | ) |