| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2e5731e commit 5bebd7e
122 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,47 @@ | |||
| 1 | + --- | ||
| 2 | + # Configuration file for clang-tidy | ||
| 3 | + # This configuration is tailored for the libuv C library project | ||
| 4 | + | ||
| 5 | + # Use default checks with minimal necessary disables | ||
| 6 | + Checks: | ||
| 7 | + # don't suggest reordering struct definitions | ||
| 8 | + - -clang-analyzer-optin.performance.Padding | ||
| 9 | + # allow memcpy (instead of memcpy_s) | ||
| 10 | + - -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling | ||
| 11 | + # allow strcpy | ||
| 12 | + - -clang-analyzer-security.insecureAPI.strcpy | ||
| 13 | + # allow TBAA | ||
| 14 | + - -clang-analyzer-unix.MallocSizeof | ||
| 15 | + # always allow `if () statement;` instead of `if () { statement; }` | ||
| 16 | + - -readability-braces-around-statements | ||
| 17 | + # allow any use of case and _ conventions in names | ||
| 18 | + - -readability-identifier-naming | ||
| 19 | + # allow defining a function prototype without naming all arguments | ||
| 20 | + - -readability-named-parameter | ||
| 21 | + # allow 1u instead of 1U constants | ||
| 22 | + - -readability-uppercase-literal-suffix | ||
| 23 | + | ||
| 24 | + # Configure specific check options | ||
| 25 | + CheckOptions: | ||
| 26 | + - key: performance-unnecessary-value-param.AllowedTypes | ||
| 27 | + value: 'uv_.*_t' | ||
| 28 | + - key: readability-braces-around-statements.ShortStatementLines | ||
| 29 | + value: '2' | ||
| 30 | + - key: readability-function-size.LineThreshold | ||
| 31 | + value: '150' | ||
| 32 | + - key: readability-function-size.StatementThreshold | ||
| 33 | + value: '80' | ||
| 34 | + - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic | ||
| 35 | + value: 'true' | ||
| 36 | + | ||
| 37 | + # Header filter - only analyze project files, not system headers | ||
| 38 | + HeaderFilterRegex: '^.*/(src|include|test)/.*\.(h|c)$' | ||
| 39 | + | ||
| 40 | + # Format style for fix suggestions | ||
| 41 | + FormatStyle: file | ||
| 42 | + | ||
| 43 | + # Treat warnings as errors | ||
| 44 | + WarningsAsErrors: false | ||
| 45 | + | ||
| 46 | + # Use color, even when run through a program like ninja | ||
| 47 | + UseColor: true | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,8 +27,10 @@ Jesse Gorzinski <jgorzinski@gmail.com> | |||
| 27 | 27 | Jesse Gorzinski <jgorzinski@gmail.com> <jgorzins@us.ibm.com> | |
| 28 | 28 | Juan José Arboleda <soyjuanarbol@gmail.com> | |
| 29 | 29 | Justin Venus <justin.venus@gmail.com> <justin.venus@orbitz.com> | |
| 30 | + Keno Fischer <kenof@stanford.edu> <keno@juliahub.com> | ||
| 30 | 31 | Keno Fischer <kenof@stanford.edu> <kfischer+github@college.harvard.edu> | |
| 31 | 32 | Keno Fischer <kenof@stanford.edu> <kfischer@college.harvard.edu> | |
| 33 | + Lawrence Stubbs <technoexpressnet@gmail.com> <lstubbs@techno.express> | ||
| 32 | 34 | Leith Bade <leith@leithalweapon.geek.nz> <leith@mapbox.com> | |
| 33 | 35 | Leonard Hecker <leonard.hecker91@gmail.com> <leonard@hecker.io> | |
| 34 | 36 | Lewis Russell <me@lewisr.dev> <lewis6991@gmail.com> | |
@@ -42,7 +44,8 @@ Nick Logan <ugexe@cpan.org> <nlogan@gmail.com> | |||
| 42 | 44 | Olivier Valentin <ovalenti@redhat.com> <valentio@free.fr> | |
| 43 | 45 | Rasmus Christian Pedersen <zerhacken@yahoo.com> | |
| 44 | 46 | Rasmus Christian Pedersen <zerhacken@yahoo.com> <ruysch@outlook.com> | |
| 45 | - Richard Lau <rlau@redhat.com> <riclau@uk.ibm.com> | ||
| 47 | + Richard Lau <richard.lau@ibm.com> <riclau@uk.ibm.com> | ||
| 48 | + Richard Lau <richard.lau@ibm.com> <rlau@redhat.com> | ||
| 46 | 49 | Robert Mustacchi <rm@joyent.com> <rm@fingolfin.org> | |
| 47 | 50 | Ryan Dahl <ryan@joyent.com> <ry@tinyclouds.org> | |
| 48 | 51 | Ryan Emery <seebees@gmail.com> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -210,7 +210,7 @@ guworks <ground.up.works@gmail.com> | |||
| 210 | 210 | RossBencina <rossb@audiomulch.com> | |
| 211 | 211 | Roger A. Light <roger@atchoo.org> | |
| 212 | 212 | chenttuuvv <chenttuuvv@yahoo.com> | |
| 213 | - Richard Lau <rlau@redhat.com> | ||
| 213 | + Richard Lau <richard.lau@ibm.com> | ||
| 214 | 214 | ronkorving <rkorving@wizcorp.jp> | |
| 215 | 215 | Corbin Simpson <MostAwesomeDude@gmail.com> | |
| 216 | 216 | Zachary Hamm <zsh@imipolexg.org> | |
@@ -604,3 +604,33 @@ mugitya03 <mugitya233@outlook.com> | |||
| 604 | 604 | Itay Bookstein <ibookstein@gmail.com> | |
| 605 | 605 | crupest <crupest@outlook.com> | |
| 606 | 606 | AE1020 <68134252+AE1020@users.noreply.github.com> | |
| 607 | + dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | ||
| 608 | + jhnh204 <51738134+jhnh204@users.noreply.github.com> | ||
| 609 | + chemodax <53048645+chemodax@users.noreply.github.com> | ||
| 610 | + Deep C <dchordia@blackberry.com> | ||
| 611 | + Luca Saccarola <96259932+saccarosium@users.noreply.github.com> | ||
| 612 | + wisemanny <118970226+wisemanny@users.noreply.github.com> | ||
| 613 | + Sean Dewar <6256228+seandewar@users.noreply.github.com> | ||
| 614 | + Lawrence Stubbs <technoexpressnet@gmail.com> | ||
| 615 | + Emily <hello@emily.moe> | ||
| 616 | + Anton Kirilov <anton.kirilov@arm.com> | ||
| 617 | + Savas Sahin <savashn@proton.me> | ||
| 618 | + m0cg <mane9999@gmail.com> | ||
| 619 | + moe li <creeperblin@outlook.com> | ||
| 620 | + green-br <thomas.green@bristol.ac.uk> | ||
| 621 | + Christian Guinard <28689358+christiangnrd@users.noreply.github.com> | ||
| 622 | + Gang Zhuo <gang.zhuo@gmail.com> | ||
| 623 | + Ayush Kumar <ayushkumarkvs160@gmail.com> | ||
| 624 | + Ambuj Vashistha <ambujva123@gmail.com> | ||
| 625 | + Bart Louwers <bart.louwers@gmail.com> | ||
| 626 | + Kartik Puri <84309847+BOXER78@users.noreply.github.com> | ||
| 627 | + Oblivionsage <126214490+Oblivionsage@users.noreply.github.com> | ||
| 628 | + Cody Tapscott <84105208+topolarity@users.noreply.github.com> | ||
| 629 | + tobil4sk <tobil4sk@outlook.com> | ||
| 630 | + Han Gao <rabenda.cn@gmail.com> | ||
| 631 | + mischief <mischief@offblast.org> | ||
| 632 | + StefanStojanovic <stefan.stojanovic@janeasystems.com> | ||
| 633 | + Przemysław Sobala <przemyslaw.sobala@grupawp.pl> | ||
| 634 | + Quaylyn Rimer <31830590+killerdevildog@users.noreply.github.com> | ||
| 635 | + Yasser Nascimento <dev@yasser.email> | ||
| 636 | + Rudi Heitbaum <rudi@heitbaum.com> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,7 @@ set(CMAKE_C_STANDARD 11) | |||
| 24 | 24 | ||
| 25 | 25 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | |
| 26 | 26 | ||
| 27 | + | ||
| 27 | 28 | option(LIBUV_BUILD_SHARED "Build shared lib" ON) | |
| 28 | 29 | ||
| 29 | 30 | cmake_dependent_option(LIBUV_BUILD_TESTS | |
@@ -700,6 +701,8 @@ if(LIBUV_BUILD_TESTS) | |||
| 700 | 701 | test/test-udp-send-immediate.c | |
| 701 | 702 | test/test-udp-sendmmsg-error.c | |
| 702 | 703 | test/test-udp-send-unreachable.c | |
| 704 | + test/test-udp-recv-cb-close-pollerr.c | ||
| 705 | + test/test-udp-recvmsg-unreachable-error.c | ||
| 703 | 706 | test/test-udp-try-send.c | |
| 704 | 707 | test/test-udp-recv-in-a-row.c | |
| 705 | 708 | test/test-udp-reuseport.c | |
@@ -747,6 +750,14 @@ if(LIBUV_BUILD_TESTS) | |||
| 747 | 750 | "$<TARGET_FILE:uv_run_tests_a>" | |
| 748 | 751 | "$<TARGET_FILE_DIR:uv_run_tests_a>/uv_run_tests_a_no_ext") | |
| 749 | 752 | endif() | |
| 753 | + | ||
| 754 | + if(QNX) | ||
| 755 | + install(TARGETS uv_run_tests uv_run_tests_a uv_run_benchmarks_a | ||
| 756 | + DESTINATION ${CMAKE_INSTALL_BINDIR}/libuv_tests) | ||
| 757 | + | ||
| 758 | + install(DIRECTORY test/fixtures | ||
| 759 | + DESTINATION ${CMAKE_INSTALL_BINDIR}/libuv_tests) | ||
| 760 | + endif() | ||
| 750 | 761 | endif() | |
| 751 | 762 | ||
| 752 | 763 | # Now for some gibbering horrors from beyond the stars... | |
@@ -774,6 +785,11 @@ install(TARGETS uv_a EXPORT libuvConfig | |||
| 774 | 785 | install(EXPORT libuvConfig | |
| 775 | 786 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv | |
| 776 | 787 | NAMESPACE libuv::) | |
| 788 | + write_basic_package_version_file(libuvConfigVersion.cmake | ||
| 789 | + VERSION ${PACKAGE_VERSION} | ||
| 790 | + COMPATIBILITY SameMajorVersion) | ||
| 791 | + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libuvConfigVersion.cmake | ||
| 792 | + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv) | ||
| 777 | 793 | ||
| 778 | 794 | if(LIBUV_BUILD_SHARED) | |
| 779 | 795 | # The version in the filename is mirroring the behaviour of autotools. | |
@@ -814,3 +830,77 @@ message(STATUS "summary of build options: | |||
| 814 | 830 | C compiler: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID}) | |
| 815 | 831 | CFLAGS: ${CMAKE_C_FLAGS_${_build_type}} ${CMAKE_C_FLAGS} | |
| 816 | 832 | ") | |
| 833 | + | ||
| 834 | + # clang-tidy support | ||
| 835 | + option(ENABLE_CLANG_TIDY "Enable clang-tidy checks" ON) | ||
| 836 | + if(ENABLE_CLANG_TIDY) | ||
| 837 | + find_program(CLANG_TIDY_EXE NAMES "clang-tidy") | ||
| 838 | + if(CLANG_TIDY_EXE) | ||
| 839 | + set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXE}") | ||
| 840 | + message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") | ||
| 841 | + else() | ||
| 842 | + set(CMAKE_C_CLANG_TIDY "clang-tidy") | ||
| 843 | + message(STATUS "clang-tidy not found: install clang-tidy or set -DCLANG_TIDY_EXE to run tidy analysis on this platform") | ||
| 844 | + endif() | ||
| 845 | + | ||
| 846 | + # Collect source files from existing targets (deduplicated) | ||
| 847 | + set(ALL_SOURCE_FILES) | ||
| 848 | + set(SRC_TARGETS) | ||
| 849 | + set(TEST_TARGETS) | ||
| 850 | + set(TIDY_TARGETS) | ||
| 851 | + | ||
| 852 | + # Add main library sources | ||
| 853 | + list(APPEND ALL_SOURCE_FILES ${uv_sources}) | ||
| 854 | + | ||
| 855 | + # Add test sources if tests are enabled | ||
| 856 | + if(LIBUV_BUILD_TESTS) | ||
| 857 | + list(APPEND ALL_SOURCE_FILES ${uv_test_sources}) | ||
| 858 | + endif() | ||
| 859 | + | ||
| 860 | + # Remove duplicates and non-existent files | ||
| 861 | + list(REMOVE_DUPLICATES ALL_SOURCE_FILES) | ||
| 862 | + | ||
| 863 | + foreach(SOURCE_FILE ${ALL_SOURCE_FILES}) | ||
| 864 | + # Create a clean target name | ||
| 865 | + string(REPLACE "/" "-" TARGET_NAME ${SOURCE_FILE}) | ||
| 866 | + string(REGEX REPLACE "\\.[^.]*$" "" TARGET_NAME ${TARGET_NAME}) | ||
| 867 | + set(FULL_TARGET_NAME "tidy-${TARGET_NAME}") | ||
| 868 | + | ||
| 869 | + # Create individual target for this source file | ||
| 870 | + add_custom_target(${FULL_TARGET_NAME} | ||
| 871 | + COMMAND ${CMAKE_C_CLANG_TIDY} -p "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE}" | ||
| 872 | + COMMENT "Running clang-tidy on ${SOURCE_FILE}" | ||
| 873 | + VERBATIM) | ||
| 874 | + | ||
| 875 | + # Add to appropriate folder list | ||
| 876 | + if(SOURCE_FILE MATCHES "^src/") | ||
| 877 | + list(APPEND SRC_TARGETS ${FULL_TARGET_NAME}) | ||
| 878 | + elseif(SOURCE_FILE MATCHES "^test/") | ||
| 879 | + list(APPEND TEST_TARGETS ${FULL_TARGET_NAME}) | ||
| 880 | + endif() | ||
| 881 | + | ||
| 882 | + # Add to list of all tidy targets | ||
| 883 | + list(APPEND TIDY_TARGETS ${FULL_TARGET_NAME}) | ||
| 884 | + endforeach() | ||
| 885 | + | ||
| 886 | + # Create folder-based targets | ||
| 887 | + if(SRC_TARGETS) | ||
| 888 | + add_custom_target(tidy-src | ||
| 889 | + COMMENT "Running clang-tidy on src files" | ||
| 890 | + VERBATIM) | ||
| 891 | + add_dependencies(tidy-src ${SRC_TARGETS}) | ||
| 892 | + endif() | ||
| 893 | + | ||
| 894 | + if(TEST_TARGETS) | ||
| 895 | + add_custom_target(tidy-test | ||
| 896 | + COMMENT "Running clang-tidy on test files" | ||
| 897 | + VERBATIM) | ||
| 898 | + add_dependencies(tidy-test ${TEST_TARGETS}) | ||
| 899 | + endif() | ||
| 900 | + | ||
| 901 | + # Create main tidy target that depends on all individual targets | ||
| 902 | + add_custom_target(tidy | ||
| 903 | + COMMENT "Running clang-tidy on all source files" | ||
| 904 | + VERBATIM) | ||
| 905 | + add_dependencies(tidy ${TIDY_TARGETS}) | ||
| 906 | + endif() | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments