|
7 | 7 | # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
8 | 8 | # EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
|
9 | 9 | # WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
| 10 | +load("@rules_cc//cc:defs.bzl", "cc_library") |
| 11 | +load("@rules_swiftnav//tools:configure_file.bzl", "configure_file") |
10 | 12 |
|
11 |
| -load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") |
| 13 | +configure_file( |
| 14 | + name = "config_h", |
| 15 | + out = "config.h", |
| 16 | + template = "cmake/config.h.in", |
| 17 | + vars = { |
| 18 | + "HAVE_INT16_T": "1", |
| 19 | + "HAVE_INT32_T": "1", |
| 20 | + "HAVE_INT64_T": "1", |
| 21 | + "HAVE_INTMAX_T": "1", |
| 22 | + "HAVE_UINT8_T": "1", |
| 23 | + "HAVE_UINT16_T": "1", |
| 24 | + "HAVE_UINT32_T": "1", |
| 25 | + "HAVE_UINT64_T": "1", |
| 26 | + "HAVE_UINTMAX_T": "1", |
| 27 | + "HAVE___INT64": "0", |
| 28 | + "HAVE_U_INT64_T": "0", |
| 29 | + "HAVE_UNSIGNED___INT64": "0", |
| 30 | + "SIZE_OF_SHORT_CODE": "#define SIZE_OF_SHORT 2", |
| 31 | + "SIZE_OF_INT_CODE": "#define SIZE_OF_INT 4", |
| 32 | + "SIZE_OF_LONG_CODE": "#define SIZE_OF_LONG 8", |
| 33 | + "SIZE_OF_LONG_LONG_CODE": "#define SIZE_OF_LONG_LONG 8", |
| 34 | + "SIZE_OF_UNSIGNED_SHORT_CODE": "#define SIZE_OF_UNSIGNED_SHORT 2", |
| 35 | + "SIZE_OF_UNSIGNED_CODE": "#define SIZE_OF_UNSIGNED 4", |
| 36 | + "SIZE_OF_UNSIGNED_LONG_CODE": "#define SIZE_OF_UNSIGNED_LONG 8", |
| 37 | + "SIZE_OF_UNSIGNED_LONG_LONG_CODE": "#define SIZE_OF_UNSIGNED_LONG_LONG 8", |
| 38 | + "HAVE_DECL_INT64_MAX": "0", |
| 39 | + "HAVE_DECL_INT64_MIN": "0", |
| 40 | + "HAVE_DECL_SIZE_MAX": "0", |
| 41 | + "HAVE_DECL_SSIZE_MAX": "0", |
| 42 | + "HAVE_DECL_UINT32_MAX": "0", |
| 43 | + "HAVE_DECL_UINT64_MAX": "0", |
| 44 | + "HAVE_ERRNO_H": "1", |
| 45 | + "HAVE_FORK": "1", |
| 46 | + "HAVE_GETPID": "1", |
| 47 | + "HAVE_GETTIMEOFDAY": "1", |
| 48 | + "HAVE_INTTYPES_H": "1", |
| 49 | + "HAVE_LIMITS_H": "1", |
| 50 | + "HAVE_DECL_LOCALTIME_R": "1", |
| 51 | + "HAVE_LOCALTIME_S": "0", |
| 52 | + "HAVE_LONG_LONG_INT": "0", |
| 53 | + "HAVE_MALLOC": "1", |
| 54 | + "HAVE_REALLOC": "1", |
| 55 | + "HAVE_DECL_SETENV": "1", |
| 56 | + "HAVE_SIGNAL_H": "1", |
| 57 | + "HAVE_SIGACTION": "1", |
| 58 | + "HAVE_STDARG_H": "1", |
| 59 | + "HAVE_STDINT_H": "1", |
| 60 | + "HAVE_STDLIB_H": "1", |
| 61 | + "HAVE_DECL_STRDUP": "1", |
| 62 | + "HAVE_STRINGS_H": "1", |
| 63 | + "HAVE_STRING_H": "1", |
| 64 | + "HAVE_DECL_STRSIGNAL": "1", |
| 65 | + "HAVE_SYS_TIME_H": "1", |
| 66 | + "HAVE_SYS_TYPES_H": "1", |
| 67 | + "HAVE_TIME_H": "1", |
| 68 | + "HAVE_UNISTD_H": "1", |
| 69 | + "HAVE_WINDOWS_H": "0", |
| 70 | + "HAVE_SYNCHAPI_H": "0", |
| 71 | + "HAVE_INIT_ONCE_BEGIN_INITIALIZE": "0", |
| 72 | + "HAVE_INIT_ONCE_COMPLETE": "0", |
| 73 | + "HAVE_UNSIGNED_LONG_LONG": "0", |
| 74 | + "HAVE_UNSIGNED_LONG_LONG_INT": "0", |
| 75 | + "HAVE_WCHAR_T": "0", |
| 76 | + "HAVE__GETPID": "0", |
| 77 | + "HAVE__LOCALTIME64_S": "0", |
| 78 | + "HAVE__STRDUP": "0", |
| 79 | + "HAVE_PTHREAD": "1", |
| 80 | + "CHECK_VERSION": "0", |
| 81 | + "SIZEOF_WCHAR_T": "0", |
| 82 | + "STRERROR_R_CHAR_P": "0", |
| 83 | + "TIME_WITH_SYS_TIME": "0", |
| 84 | + "SAFE_TO_DEFINE_EXTENSIONS": "0", |
| 85 | + "_FILE_OFFSET_BITS": "0", |
| 86 | + "_LARGEFILE_SOURCE": "0", |
| 87 | + "_LARGE_FILES": "0", |
| 88 | + "_WIN32_WINNT": "0", |
| 89 | + "WINVER": "0", |
| 90 | + "const": "0", |
| 91 | + "clockid_t": "0", |
| 92 | + "gid_t": "0", |
| 93 | + "id_t": "0", |
| 94 | + "mode_t": "0", |
| 95 | + "off_t": "0", |
| 96 | + "pid_t": "0", |
| 97 | + "size_t": "0", |
| 98 | + "ssize_t": "0", |
| 99 | + "timer_t": "0", |
| 100 | + "uid_t": "0", |
| 101 | + "intptr_t": "0", |
| 102 | + "uintptr_t": "0", |
| 103 | + }, |
| 104 | +) |
12 | 105 |
|
13 |
| -filegroup( |
14 |
| - name = "srcs", |
15 |
| - srcs = glob(["**"]), |
| 106 | +configure_file( |
| 107 | + name = "check_h", |
| 108 | + out = "check.h", |
| 109 | + template = "src/check.h.in", |
| 110 | + vars = { |
| 111 | + "CHECK_MAJOR_VERSION": "(0)", |
| 112 | + "CHECK_MINOR_VERSION": "(15)", |
| 113 | + "CHECK_MICRO_VERSION": "(2)", |
| 114 | + "HAVE_FORK": "1", |
| 115 | + "ENABLE_SUBUNIT": "0", |
| 116 | + }, |
16 | 117 | )
|
17 | 118 |
|
18 |
| -cmake( |
19 |
| - name = "check", |
20 |
| - cache_entries = { |
21 |
| - "CMAKE_C_FLAGS": "-fPIC", |
22 |
| - "CMAKE_INSTALL_LIBDIR": "lib", |
23 |
| - "HAVE_SUBUNIT": "0", |
| 119 | +configure_file( |
| 120 | + name = "check_stdint_h", |
| 121 | + out = "check_stdint.h", |
| 122 | + template = "cmake/check_stdint.h.in", |
| 123 | + vars = { |
| 124 | + "HAVE_STDINT_H": "1", |
24 | 125 | },
|
25 |
| - lib_source = ":srcs", |
26 |
| - linkopts = select({ |
27 |
| - "@bazel_tools//src/conditions:darwin": ["-lpthread"], |
28 |
| - "//conditions:default": [ |
29 |
| - "-lpthread", |
30 |
| - "-lrt", |
31 |
| - ], |
32 |
| - }), |
33 |
| - out_static_libs = select({ |
34 |
| - "@bazel_tools//src/conditions:windows": ["check.lib"], |
35 |
| - "//conditions:default": ["libcheck.a"], |
36 |
| - }), |
| 126 | +) |
| 127 | + |
| 128 | +cc_library( |
| 129 | + name = "check", |
| 130 | + srcs = [ |
| 131 | + "lib/fpclassify.c", |
| 132 | + "lib/libcompat.h", |
| 133 | + "src/check.c", |
| 134 | + "src/check_error.c", |
| 135 | + "src/check_list.c", |
| 136 | + "src/check_log.c", |
| 137 | + "src/check_msg.c", |
| 138 | + "src/check_pack.c", |
| 139 | + "src/check_print.c", |
| 140 | + "src/check_run.c", |
| 141 | + "src/check_str.c", |
| 142 | + ], |
| 143 | + hdrs = [ |
| 144 | + "src/check_error.h", |
| 145 | + "src/check_impl.h", |
| 146 | + "src/check_list.h", |
| 147 | + "src/check_log.h", |
| 148 | + "src/check_msg.h", |
| 149 | + "src/check_pack.h", |
| 150 | + "src/check_print.h", |
| 151 | + "src/check_str.h", |
| 152 | + ":check_h", |
| 153 | + ":check_stdint_h", |
| 154 | + ":config_h", |
| 155 | + ], |
| 156 | + include_prefix = ".", |
| 157 | + includes = [ |
| 158 | + "src", |
| 159 | + ], |
| 160 | + local_defines = ["HAVE_PTHREAD"], |
37 | 161 | visibility = ["//visibility:public"],
|
38 | 162 | )
|
0 commit comments