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:
@@ -47,8 +47,7 @@ set(test_gnc_path_util_SOURCES
|
||||
${MODULEPATH}/binreloc.c
|
||||
${MODULEPATH}/gnc-filepath-utils.cpp
|
||||
${MODULEPATH}/gnc-locale-utils.cpp
|
||||
gtest-path-utilities.cpp
|
||||
${GTEST_SRC})
|
||||
gtest-path-utilities.cpp)
|
||||
|
||||
gnc_add_test(test-gnc-path-util "${test_gnc_path_util_SOURCES}"
|
||||
gtest_core_utils_INCLUDES gtest_core_utils_LIBS "GNC_UNINSTALLED=yes")
|
||||
|
||||
@@ -122,30 +122,26 @@ endif (WIN32)
|
||||
|
||||
set(test_gnc_guid_SOURCES
|
||||
${MODULEPATH}/guid.cpp
|
||||
test-gnc-guid.cpp
|
||||
${GTEST_SRC})
|
||||
test-gnc-guid.cpp)
|
||||
gnc_add_test(test-gnc-guid "${test_gnc_guid_SOURCES}"
|
||||
gtest_engine_INCLUDES gtest_old_engine_LIBS)
|
||||
|
||||
set(test_kvp_value_SOURCES
|
||||
${MODULEPATH}/kvp-value.cpp
|
||||
test-kvp-value.cpp
|
||||
test-kvp-frame.cpp
|
||||
${GTEST_SRC})
|
||||
test-kvp-frame.cpp)
|
||||
gnc_add_test(test-kvp-value "${test_kvp_value_SOURCES}"
|
||||
gtest_engine_INCLUDES gtest_old_engine_LIBS)
|
||||
|
||||
set(test_qofsession_SOURCES
|
||||
${MODULEPATH}/qofsession.cpp
|
||||
test-qofsession.cpp
|
||||
${GTEST_SRC})
|
||||
test-qofsession.cpp)
|
||||
gnc_add_test(test-qofsession "${test_qofsession_SOURCES}"
|
||||
gtest_engine_INCLUDES gtest_old_engine_LIBS)
|
||||
|
||||
set(test_gnc_int128_SOURCES
|
||||
${MODULEPATH}/gnc-int128.cpp
|
||||
gtest-gnc-int128.cpp
|
||||
${GTEST_SRC})
|
||||
gtest-gnc-int128.cpp)
|
||||
gnc_add_test(test-gnc-int128 "${test_gnc_int128_SOURCES}"
|
||||
gtest_engine_INCLUDES gtest_qof_LIBS)
|
||||
|
||||
@@ -159,8 +155,7 @@ set(test_gnc_rational_SOURCES
|
||||
${MODULEPATH}/qoflog.cpp
|
||||
${CMAKE_SOURCE_DIR}/libgnucash/core-utils/gnc-locale-utils.cpp
|
||||
${gtest_engine_win32_SOURCES}
|
||||
gtest-gnc-rational.cpp
|
||||
${GTEST_SRC})
|
||||
gtest-gnc-rational.cpp)
|
||||
|
||||
gnc_add_test(test-gnc-rational "${test_gnc_rational_SOURCES}"
|
||||
gtest_engine_INCLUDES gtest_qof_LIBS)
|
||||
@@ -175,15 +170,13 @@ set(test_gnc_numeric_SOURCES
|
||||
${MODULEPATH}/qoflog.cpp
|
||||
${CMAKE_SOURCE_DIR}/libgnucash/core-utils/gnc-locale-utils.cpp
|
||||
${gtest_engine_win32_SOURCES}
|
||||
gtest-gnc-numeric.cpp
|
||||
${GTEST_SRC})
|
||||
gtest-gnc-numeric.cpp)
|
||||
gnc_add_test(test-gnc-numeric "${test_gnc_numeric_SOURCES}"
|
||||
gtest_engine_INCLUDES gtest_qof_LIBS)
|
||||
|
||||
set(test_gnc_timezone_SOURCES
|
||||
${MODULEPATH}/gnc-timezone.cpp
|
||||
gtest-gnc-timezone.cpp
|
||||
${GTEST_SRC})
|
||||
gtest-gnc-timezone.cpp)
|
||||
gnc_add_test(test-gnc-timezone "${test_gnc_timezone_SOURCES}"
|
||||
gtest_engine_INCLUDES gtest_old_engine_LIBS)
|
||||
|
||||
@@ -194,20 +187,17 @@ set(test_gnc_datetime_SOURCES
|
||||
${MODULEPATH}/qoflog.cpp
|
||||
${CMAKE_SOURCE_DIR}/libgnucash/core-utils/gnc-locale-utils.cpp
|
||||
${gtest_engine_win32_SOURCES}
|
||||
gtest-gnc-datetime.cpp
|
||||
${GTEST_SRC})
|
||||
gtest-gnc-datetime.cpp)
|
||||
gnc_add_test(test-gnc-datetime "${test_gnc_datetime_SOURCES}"
|
||||
gtest_engine_INCLUDES gtest_qof_LIBS)
|
||||
|
||||
set(test_import_map_SOURCES
|
||||
gtest-import-map.cpp
|
||||
${GTEST_SRC})
|
||||
gtest-import-map.cpp)
|
||||
gnc_add_test(test-import-map "${test_import_map_SOURCES}"
|
||||
gtest_engine_INCLUDES gtest_old_engine_LIBS)
|
||||
|
||||
set(test_qofquerycore_SOURCES
|
||||
gtest-qofquerycore.cpp
|
||||
${GTEST_SRC})
|
||||
gtest-qofquerycore.cpp)
|
||||
gnc_add_test(test-qofquerycore "${test_qofquerycore_SOURCES}"
|
||||
gtest_engine_INCLUDES gtest_old_engine_LIBS)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user