1# 2# Copyright 2017 The Abseil Authors. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# https://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16 17find_library(LIBRT rt) 18 19# Internal-only target, do not depend on directly. 20absl_cc_library( 21 NAME 22 atomic_hook 23 HDRS 24 "internal/atomic_hook.h" 25 DEPS 26 absl::config 27 absl::core_headers 28 COPTS 29 ${ABSL_DEFAULT_COPTS} 30) 31 32# Internal-only target, do not depend on directly. 33absl_cc_library( 34 NAME 35 errno_saver 36 HDRS 37 "internal/errno_saver.h" 38 DEPS 39 absl::config 40 COPTS 41 ${ABSL_DEFAULT_COPTS} 42) 43 44absl_cc_library( 45 NAME 46 log_severity 47 HDRS 48 "log_severity.h" 49 SRCS 50 "log_severity.cc" 51 DEPS 52 absl::core_headers 53 COPTS 54 ${ABSL_DEFAULT_COPTS} 55) 56 57# Internal-only target, do not depend on directly. 58absl_cc_library( 59 NAME 60 raw_logging_internal 61 HDRS 62 "internal/raw_logging.h" 63 SRCS 64 "internal/raw_logging.cc" 65 DEPS 66 absl::atomic_hook 67 absl::config 68 absl::core_headers 69 absl::errno_saver 70 absl::log_severity 71 COPTS 72 ${ABSL_DEFAULT_COPTS} 73) 74 75# Internal-only target, do not depend on directly. 76absl_cc_library( 77 NAME 78 spinlock_wait 79 HDRS 80 "internal/spinlock_wait.h" 81 SRCS 82 "internal/spinlock_akaros.inc" 83 "internal/spinlock_linux.inc" 84 "internal/spinlock_posix.inc" 85 "internal/spinlock_wait.cc" 86 "internal/spinlock_win32.inc" 87 COPTS 88 ${ABSL_DEFAULT_COPTS} 89 DEPS 90 absl::base_internal 91 absl::core_headers 92 absl::errno_saver 93) 94 95absl_cc_library( 96 NAME 97 config 98 HDRS 99 "config.h" 100 "options.h" 101 "policy_checks.h" 102 COPTS 103 ${ABSL_DEFAULT_COPTS} 104 PUBLIC 105) 106 107absl_cc_library( 108 NAME 109 dynamic_annotations 110 HDRS 111 "dynamic_annotations.h" 112 COPTS 113 ${ABSL_DEFAULT_COPTS} 114 DEPS 115 absl::config 116 PUBLIC 117) 118 119absl_cc_library( 120 NAME 121 core_headers 122 HDRS 123 "attributes.h" 124 "const_init.h" 125 "macros.h" 126 "optimization.h" 127 "port.h" 128 "thread_annotations.h" 129 COPTS 130 ${ABSL_DEFAULT_COPTS} 131 DEPS 132 absl::config 133 PUBLIC 134) 135 136# Internal-only target, do not depend on directly. 137absl_cc_library( 138 NAME 139 malloc_internal 140 HDRS 141 "internal/direct_mmap.h" 142 "internal/low_level_alloc.h" 143 SRCS 144 "internal/low_level_alloc.cc" 145 COPTS 146 ${ABSL_DEFAULT_COPTS} 147 DEPS 148 absl::base 149 absl::base_internal 150 absl::config 151 absl::core_headers 152 absl::dynamic_annotations 153 absl::raw_logging_internal 154 Threads::Threads 155) 156 157# Internal-only target, do not depend on directly. 158absl_cc_library( 159 NAME 160 base_internal 161 HDRS 162 "internal/hide_ptr.h" 163 "internal/identity.h" 164 "internal/inline_variable.h" 165 "internal/invoke.h" 166 "internal/scheduling_mode.h" 167 COPTS 168 ${ABSL_DEFAULT_COPTS} 169 DEPS 170 absl::config 171 absl::type_traits 172) 173 174absl_cc_library( 175 NAME 176 base 177 HDRS 178 "call_once.h" 179 "casts.h" 180 "internal/cycleclock.h" 181 "internal/cycleclock_config.h" 182 "internal/low_level_scheduling.h" 183 "internal/per_thread_tls.h" 184 "internal/spinlock.h" 185 "internal/sysinfo.h" 186 "internal/thread_identity.h" 187 "internal/tsan_mutex_interface.h" 188 "internal/unscaledcycleclock.h" 189 "internal/unscaledcycleclock_config.h" 190 SRCS 191 "internal/cycleclock.cc" 192 "internal/spinlock.cc" 193 "internal/sysinfo.cc" 194 "internal/thread_identity.cc" 195 "internal/unscaledcycleclock.cc" 196 COPTS 197 ${ABSL_DEFAULT_COPTS} 198 LINKOPTS 199 ${ABSL_DEFAULT_LINKOPTS} 200 $<$<BOOL:${LIBRT}>:-lrt> 201 $<$<BOOL:${MINGW}>:-ladvapi32> 202 DEPS 203 absl::atomic_hook 204 absl::base_internal 205 absl::config 206 absl::core_headers 207 absl::dynamic_annotations 208 absl::log_severity 209 absl::raw_logging_internal 210 absl::spinlock_wait 211 absl::type_traits 212 Threads::Threads 213 PUBLIC 214) 215 216# Internal-only target, do not depend on directly. 217absl_cc_library( 218 NAME 219 throw_delegate 220 HDRS 221 "internal/throw_delegate.h" 222 SRCS 223 "internal/throw_delegate.cc" 224 COPTS 225 ${ABSL_DEFAULT_COPTS} 226 DEPS 227 absl::config 228 absl::raw_logging_internal 229) 230 231# Internal-only target, do not depend on directly. 232absl_cc_library( 233 NAME 234 exception_testing 235 HDRS 236 "internal/exception_testing.h" 237 COPTS 238 ${ABSL_DEFAULT_COPTS} 239 DEPS 240 absl::config 241 GTest::gtest 242 TESTONLY 243) 244 245# Internal-only target, do not depend on directly. 246absl_cc_library( 247 NAME 248 pretty_function 249 HDRS 250 "internal/pretty_function.h" 251 COPTS 252 ${ABSL_DEFAULT_COPTS} 253) 254 255# Internal-only target, do not depend on directly. 256absl_cc_library( 257 NAME 258 exception_safety_testing 259 HDRS 260 "internal/exception_safety_testing.h" 261 SRCS 262 "internal/exception_safety_testing.cc" 263 COPTS 264 ${ABSL_TEST_COPTS} 265 DEPS 266 absl::config 267 absl::pretty_function 268 absl::memory 269 absl::meta 270 absl::strings 271 absl::utility 272 GTest::gtest 273 TESTONLY 274) 275 276absl_cc_test( 277 NAME 278 absl_exception_safety_testing_test 279 SRCS 280 "exception_safety_testing_test.cc" 281 COPTS 282 ${ABSL_TEST_COPTS} 283 DEPS 284 absl::exception_safety_testing 285 absl::memory 286 GTest::gtest_main 287) 288 289# Internal-only target, do not depend on directly. 290absl_cc_library( 291 NAME 292 atomic_hook_test_helper 293 SRCS 294 "internal/atomic_hook_test_helper.cc" 295 COPTS 296 ${ABSL_TEST_COPTS} 297 DEPS 298 absl::atomic_hook 299 absl::core_headers 300 TESTONLY 301) 302 303absl_cc_test( 304 NAME 305 atomic_hook_test 306 SRCS 307 "internal/atomic_hook_test.cc" 308 COPTS 309 ${ABSL_TEST_COPTS} 310 DEPS 311 absl::atomic_hook_test_helper 312 absl::atomic_hook 313 absl::core_headers 314 GTest::gmock 315 GTest::gtest_main 316) 317 318absl_cc_test( 319 NAME 320 bit_cast_test 321 SRCS 322 "bit_cast_test.cc" 323 COPTS 324 ${ABSL_TEST_COPTS} 325 DEPS 326 absl::base 327 absl::core_headers 328 GTest::gtest_main 329) 330 331absl_cc_test( 332 NAME 333 errno_saver_test 334 SRCS 335 "internal/errno_saver_test.cc" 336 COPTS 337 ${ABSL_TEST_COPTS} 338 DEPS 339 absl::errno_saver 340 absl::strerror 341 GTest::gmock 342 GTest::gtest_main 343) 344 345absl_cc_test( 346 NAME 347 throw_delegate_test 348 SRCS 349 "throw_delegate_test.cc" 350 COPTS 351 ${ABSL_TEST_COPTS} 352 DEPS 353 absl::base 354 absl::config 355 absl::throw_delegate 356 GTest::gtest_main 357) 358 359absl_cc_test( 360 NAME 361 inline_variable_test 362 SRCS 363 "internal/inline_variable_testing.h" 364 "inline_variable_test.cc" 365 "inline_variable_test_a.cc" 366 "inline_variable_test_b.cc" 367 COPTS 368 ${ABSL_TEST_COPTS} 369 DEPS 370 absl::base_internal 371 GTest::gtest_main 372) 373 374absl_cc_test( 375 NAME 376 invoke_test 377 SRCS 378 "invoke_test.cc" 379 COPTS 380 ${ABSL_TEST_COPTS} 381 DEPS 382 absl::base_internal 383 absl::memory 384 absl::strings 385 GTest::gmock 386 GTest::gtest_main 387) 388 389# Internal-only target, do not depend on directly. 390absl_cc_library( 391 NAME 392 spinlock_test_common 393 SRCS 394 "spinlock_test_common.cc" 395 COPTS 396 ${ABSL_TEST_COPTS} 397 DEPS 398 absl::base 399 absl::config 400 absl::base_internal 401 absl::core_headers 402 absl::synchronization 403 GTest::gtest 404 TESTONLY 405) 406 407# On bazel BUILD this target use "alwayslink = 1" which is not implemented here 408absl_cc_test( 409 NAME 410 spinlock_test 411 SRCS 412 "spinlock_test_common.cc" 413 COPTS 414 ${ABSL_TEST_COPTS} 415 DEPS 416 absl::base 417 absl::base_internal 418 absl::config 419 absl::core_headers 420 absl::synchronization 421 GTest::gtest_main 422) 423 424# Internal-only target, do not depend on directly. 425absl_cc_library( 426 NAME 427 endian 428 HDRS 429 "internal/endian.h" 430 "internal/unaligned_access.h" 431 COPTS 432 ${ABSL_DEFAULT_COPTS} 433 DEPS 434 absl::base 435 absl::config 436 absl::core_headers 437 PUBLIC 438) 439 440absl_cc_test( 441 NAME 442 endian_test 443 SRCS 444 "internal/endian_test.cc" 445 COPTS 446 ${ABSL_TEST_COPTS} 447 DEPS 448 absl::base 449 absl::config 450 absl::endian 451 GTest::gtest_main 452) 453 454absl_cc_test( 455 NAME 456 config_test 457 SRCS 458 "config_test.cc" 459 COPTS 460 ${ABSL_TEST_COPTS} 461 DEPS 462 absl::config 463 absl::synchronization 464 GTest::gtest_main 465) 466 467absl_cc_test( 468 NAME 469 call_once_test 470 SRCS 471 "call_once_test.cc" 472 COPTS 473 ${ABSL_TEST_COPTS} 474 DEPS 475 absl::base 476 absl::core_headers 477 absl::synchronization 478 GTest::gtest_main 479) 480 481absl_cc_test( 482 NAME 483 raw_logging_test 484 SRCS 485 "raw_logging_test.cc" 486 COPTS 487 ${ABSL_TEST_COPTS} 488 DEPS 489 absl::raw_logging_internal 490 absl::strings 491 GTest::gtest_main 492) 493 494absl_cc_test( 495 NAME 496 sysinfo_test 497 SRCS 498 "internal/sysinfo_test.cc" 499 COPTS 500 ${ABSL_TEST_COPTS} 501 DEPS 502 absl::base 503 absl::synchronization 504 GTest::gtest_main 505) 506 507absl_cc_test( 508 NAME 509 low_level_alloc_test 510 SRCS 511 "internal/low_level_alloc_test.cc" 512 COPTS 513 ${ABSL_TEST_COPTS} 514 DEPS 515 absl::malloc_internal 516 absl::node_hash_map 517 Threads::Threads 518) 519 520absl_cc_test( 521 NAME 522 thread_identity_test 523 SRCS 524 "internal/thread_identity_test.cc" 525 COPTS 526 ${ABSL_TEST_COPTS} 527 DEPS 528 absl::base 529 absl::core_headers 530 absl::synchronization 531 Threads::Threads 532 GTest::gtest_main 533) 534 535# Internal-only target, do not depend on directly. 536absl_cc_library( 537 NAME 538 scoped_set_env 539 SRCS 540 "internal/scoped_set_env.cc" 541 HDRS 542 "internal/scoped_set_env.h" 543 COPTS 544 ${ABSL_DEFAULT_COPTS} 545 DEPS 546 absl::config 547 absl::raw_logging_internal 548) 549 550absl_cc_test( 551 NAME 552 scoped_set_env_test 553 SRCS 554 "internal/scoped_set_env_test.cc" 555 COPTS 556 ${ABSL_TEST_COPTS} 557 DEPS 558 absl::scoped_set_env 559 GTest::gtest_main 560) 561 562absl_cc_test( 563 NAME 564 cmake_thread_test 565 SRCS 566 "internal/cmake_thread_test.cc" 567 COPTS 568 ${ABSL_TEST_COPTS} 569 DEPS 570 absl::base 571) 572 573absl_cc_test( 574 NAME 575 log_severity_test 576 SRCS 577 "log_severity_test.cc" 578 DEPS 579 absl::flags_internal 580 absl::flags_marshalling 581 absl::log_severity 582 absl::strings 583 GTest::gmock 584 GTest::gtest_main 585) 586 587# Internal-only target, do not depend on directly. 588absl_cc_library( 589 NAME 590 strerror 591 SRCS 592 "internal/strerror.cc" 593 HDRS 594 "internal/strerror.h" 595 COPTS 596 ${ABSL_DEFAULT_COPTS} 597 LINKOPTS 598 ${ABSL_DEFAULT_LINKOPTS} 599 DEPS 600 absl::config 601 absl::core_headers 602 absl::errno_saver 603) 604 605absl_cc_test( 606 NAME 607 strerror_test 608 SRCS 609 "internal/strerror_test.cc" 610 COPTS 611 ${ABSL_TEST_COPTS} 612 DEPS 613 absl::strerror 614 absl::strings 615 GTest::gmock 616 GTest::gtest_main 617) 618 619# Internal-only target, do not depend on directly. 620absl_cc_library( 621 NAME 622 fast_type_id 623 HDRS 624 "internal/fast_type_id.h" 625 COPTS 626 ${ABSL_DEFAULT_COPTS} 627 LINKOPTS 628 ${ABSL_DEFAULT_LINKOPTS} 629 DEPS 630 absl::config 631) 632 633absl_cc_test( 634 NAME 635 fast_type_id_test 636 SRCS 637 "internal/fast_type_id_test.cc" 638 COPTS 639 ${ABSL_TEST_COPTS} 640 DEPS 641 absl::fast_type_id 642 GTest::gtest_main 643) 644 645absl_cc_library( 646 NAME 647 prefetch 648 HDRS 649 "prefetch.h" 650 "internal/prefetch.h" 651 COPTS 652 ${ABSL_DEFAULT_COPTS} 653 LINKOPTS 654 ${ABSL_DEFAULT_LINKOPTS} 655 DEPS 656 absl::config 657 absl::core_headers # TODO(b/265984188): remove 658) 659 660absl_cc_test( 661 NAME 662 prefetch_test 663 SRCS 664 "prefetch_test.cc" 665 "internal/prefetch_test.cc" 666 COPTS 667 ${ABSL_TEST_COPTS} 668 DEPS 669 absl::prefetch 670 GTest::gtest_main 671) 672 673absl_cc_test( 674 NAME 675 optimization_test 676 SRCS 677 "optimization_test.cc" 678 COPTS 679 ${ABSL_TEST_COPTS} 680 DEPS 681 absl::core_headers 682 absl::optional 683 GTest::gtest_main 684) 685