mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Build GoogleTest & GoogleMock as submodules (#3760)
This commit is contained in:
parent
35a7780564
commit
ec4b1627d7
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
|
@ -64,8 +64,7 @@ jobs:
|
||||||
libxcb-image0 \
|
libxcb-image0 \
|
||||||
libxcb-keysyms1 \
|
libxcb-keysyms1 \
|
||||||
libxcb-render-util0 \
|
libxcb-render-util0 \
|
||||||
libxcb-xinerama0 \
|
libxcb-xinerama0
|
||||||
libgtest-dev
|
|
||||||
|
|
||||||
- name: Create build directory (Ubuntu)
|
- name: Create build directory (Ubuntu)
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
if: startsWith(matrix.os, 'ubuntu')
|
||||||
|
|
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -32,3 +32,6 @@
|
||||||
[submodule "lib/magic_enum"]
|
[submodule "lib/magic_enum"]
|
||||||
path = lib/magic_enum
|
path = lib/magic_enum
|
||||||
url = https://github.com/Neargye/magic_enum
|
url = https://github.com/Neargye/magic_enum
|
||||||
|
[submodule "lib/googletest"]
|
||||||
|
path = lib/googletest
|
||||||
|
url = https://github.com/google/googletest.git
|
||||||
|
|
|
@ -102,7 +102,18 @@ find_package(RapidJSON REQUIRED)
|
||||||
find_package(Websocketpp REQUIRED)
|
find_package(Websocketpp REQUIRED)
|
||||||
|
|
||||||
if (BUILD_TESTS)
|
if (BUILD_TESTS)
|
||||||
find_package(GTest REQUIRED)
|
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/lib/googletest" "lib/googletest")
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
BUILD_GMOCK BUILD_GTEST BUILD_SHARED_LIBS
|
||||||
|
gmock_build_tests gtest_build_samples gtest_build_tests
|
||||||
|
gtest_disable_pthreads gtest_force_shared_crt gtest_hide_internal_symbols
|
||||||
|
)
|
||||||
|
|
||||||
|
set_target_properties(gtest PROPERTIES FOLDER lib)
|
||||||
|
set_target_properties(gtest_main PROPERTIES FOLDER lib)
|
||||||
|
set_target_properties(gmock PROPERTIES FOLDER lib)
|
||||||
|
set_target_properties(gmock_main PROPERTIES FOLDER lib)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (BUILD_BENCHMARKS)
|
if (BUILD_BENCHMARKS)
|
||||||
|
|
1
lib/googletest
Submodule
1
lib/googletest
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 8d51dc50eb7e7698427fed81b85edad0e032112e
|
|
@ -25,7 +25,7 @@ add_sanitizers(${PROJECT_NAME})
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE chatterino-lib)
|
target_link_libraries(${PROJECT_NAME} PRIVATE chatterino-lib)
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE ${GTEST_BOTH_LIBRARIES})
|
target_link_libraries(${PROJECT_NAME} PRIVATE gtest gmock)
|
||||||
|
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
CHATTERINO_TEST
|
CHATTERINO_TEST
|
||||||
|
|
Loading…
Reference in a new issue