Skip to content

Commit

Permalink
update (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Officeyutong authored Aug 28, 2024
1 parent 374c2fd commit 1acd8e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ else()
add_subdirectory(cli)
endif()

if(${BPFTIME_ENABLE_UNIT_TESTING} AND NOT DEFINED Catch2_INCLUDE)
message(STATUS "Adding Catch2 seperately..")
if(${BPFTIME_ENABLE_UNIT_TESTING} AND NOT TARGET Catch2)
message(STATUS "Adding Catch2 by FetchContent at llvmbpf")
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
Expand Down
3 changes: 2 additions & 1 deletion test/unit-test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Have to fetch Catch2
if(${BPFTIME_ENABLE_UNIT_TESTING} AND NOT DEFINED Catch2_INCLUDE)

This comment has been minimized.

Copy link
@yunwei37

yunwei37 Aug 29, 2024

Member

It seems dos have some problem...

    if(${BPFTIME_ENABLE_UNIT_TESTING})
        if (NOT TARGET Catch2)
            message(STATUS "Adding Catch2 by FetchContent at llvmbpf")
            FetchContent_Declare(
                Catch2
                GIT_REPOSITORY https://github.com/catchorg/Catch2.git
                GIT_TAG v3.4.0 # Specify the version you want to use
            )

            # Make the Catch2 target available
            FetchContent_MakeAvailable(Catch2)
        endif()
    endif()

fix that

This comment has been minimized.

Copy link
@Officeyutong

Officeyutong Aug 29, 2024

Author Contributor

What does this mean?

if(${BPFTIME_ENABLE_UNIT_TESTING} AND NOT TARGET Catch2)
message(STATUS "Adding Catch2 by FetchContent at llvmbpf/test/unit-test")
Include(FetchContent)
FetchContent_Declare(
Catch2
Expand Down

0 comments on commit 1acd8e5

Please sign in to comment.