Skip to content

Commit

Permalink
(#283) теперь googletest подтягивается только при сборке TestApp
Browse files Browse the repository at this point in the history
  • Loading branch information
dak151449 committed Oct 23, 2023
1 parent 560bf7d commit a8355b4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ "main" ]
pull_request:
branches: [ main" ]
branches: [ "main" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: UnitTests

on:
push:
branches: [ "*" ]
branches: no
pull_request:
branches: [ "*" ]
branches: no

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand Down
11 changes: 1 addition & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,4 @@ add_subdirectory(libs/Interpreter)
add_subdirectory(libs/InputGenerator)
add_subdirectory(apps/InterpreterApp)
add_subdirectory(apps/InputGeneratorApp)
add_subdirectory(apps/TestsApp)

include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)

set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
add_subdirectory(apps/TestsApp)
10 changes: 10 additions & 0 deletions apps/TestsApp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
project(TestsApp)

# Create a sources variable with a link to all cpp files to compile

include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)

set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

set(SOURCES
src/Example.cpp
src/main.cpp
Expand Down

0 comments on commit a8355b4

Please sign in to comment.