mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add gtest_main.cc to libgtest.a
Currently when compiling GoogleTest from source code, source file gtest_main.cc from GoogleTest repository is not compiled into any library as in GoogleTest repository, where it is compiled into libgtest_main.a. Instead gtest_main.cc is added to source file list GTEST_SRC, which is then added to the list of source files of every single GoogleTest based test application. To simplify this gtest_main.cc is added to the source file list of target gtest now. Additionally GTEST_SRC is merged into lib_gtest_SOURCES, since both variables defined source files for GoogleTest libraries. Now target gtest generates library libgtest.a, which already contains the main function from source file gtest_main.cc. This is different to GoogleTest build system, where both are separated into two independent libraries libgtest.a and libgtest_main.a.
This commit is contained in:
@@ -129,7 +129,10 @@ function(gnc_gtest_configure)
|
||||
set(GTEST_LIB "${GTEST_MAIN_LIB};${GTEST_SHARED_LIB}" PARENT_SCOPE)
|
||||
unset(GTEST_SRC_DIR CACHE)
|
||||
else()
|
||||
set(GTEST_SRC "${GTEST_SRC_DIR}/src/gtest_main.cc" PARENT_SCOPE)
|
||||
set(lib_gtest_SOURCES
|
||||
"${GTEST_SRC_DIR}/src/gtest_main.cc"
|
||||
"${GTEST_SRC_DIR}/src/gtest-all.cc"
|
||||
PARENT_SCOPE)
|
||||
set(GTEST_LIB "${CMAKE_BINARY_DIR}/common/test-core/libgtest.a" PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
|
||||
Reference in New Issue
Block a user