gnucash master: Ubuntu 18.04 requires explicit link to pthreads.

John Ralls jralls at code.gnucash.org
Sat Sep 14 14:49:22 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/76979554 (commit)
	from  https://github.com/Gnucash/gnucash/commit/1a9fcfef (commit)



commit 76979554a0204f0051a3a37823c3c91425f1548d
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Sep 14 11:49:12 2019 -0700

    Ubuntu 18.04 requires explicit link to pthreads.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4689b1000..be361c2fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -192,6 +192,7 @@ if (WIN32)
   set(CMAKE_EXE_LINKER_FLAGS -mwindows)
 endif(WIN32)
 
+find_package(Threads REQUIRED)
 find_package(PkgConfig REQUIRED)
 
 if (NOT PKG_CONFIG_FOUND)
diff --git a/common/test-core/CMakeLists.txt b/common/test-core/CMakeLists.txt
index ef02718c4..fd0faf5e2 100644
--- a/common/test-core/CMakeLists.txt
+++ b/common/test-core/CMakeLists.txt
@@ -22,7 +22,7 @@ set_dist_list(test_core_DIST ${test_core_SOURCES} ${test_core_noinst_HEADERS} CM
         unittest-support.i unittest-support.scm)
 
 add_library(test-core STATIC ${test_core_SOURCES} ${test_core_noinst_HEADERS})
-target_link_libraries(test-core gncmod-engine ${GLIB2_LDFLAGS})
+target_link_libraries(test-core gncmod-engine PkgConfig::GLIB2)
 if (UNIX)
   target_compile_options(test-core PRIVATE -fPIC)
 endif()
@@ -41,7 +41,7 @@ gnc_add_swig_python_command (swig-unittest-support-python
 )
 
 add_library(test-core-guile ${SWIG_UNITTEST_SUPPORT_GUILE_C})
-target_link_libraries(test-core-guile test-core ${GUILE_LDFLAGS} ${GLIB2_LDFLAGS})
+target_link_libraries(test-core-guile test-core PkgConfig::GUILE PkgConfig::GLIB2)
 
 if (WITH_PYTHON)
   add_library(unittest_support MODULE ${SWIG_UNITTEST_SUPPORT_PYTHON_C})
@@ -81,6 +81,7 @@ if (GTEST_SRC_DIR)
   else()
     target_compile_options(gtest PRIVATE -Wno-missing-declarations)
   endif()
+  target_link_libraries(gtest Threads::Threads)
   target_include_directories(gtest PUBLIC ${GTEST_INCLUDE_DIR} ${GTEST_SRC_DIR})
 else()
   add_library(gtest UNKNOWN IMPORTED GLOBAL)



Summary of changes:
 CMakeLists.txt                  | 1 +
 common/test-core/CMakeLists.txt | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list