Fix boost dependencies

* Add Boost::locale explicetly to the CMake since nanoodbc requires it
* Don't let nanoodbc add all Boost libraries to the link line, since it
  is used in common, and it was pulling the unit test framework into
  common then.
This commit is contained in:
Ian McInerney 2023-03-11 13:19:04 +00:00
parent c9351dfd67
commit e20b33cb66
4 changed files with 11 additions and 5 deletions

View File

@ -775,6 +775,13 @@ include_directories( SYSTEM ${PIXMAN_INCLUDE_DIR} )
#
# Find Boost headers and libraries, required.
set( BOOST_REQUESTED_COMPONENTS locale ) # locale is required by nanoodbc/database libraries
if( KICAD_BUILD_QA_TESTS )
# required by the unit test framework
list( APPEND BOOST_REQUESTED_COMPONENTS unit_test_framework system )
endif()
find_package( Boost 1.71.0 REQUIRED COMPONENTS ${BOOST_REQUESTED_COMPONENTS} )
#

View File

@ -489,8 +489,10 @@ target_link_libraries( common
pybind11::embed
compoundfilereader
pcm_settings
nanodbc # for now; maybe hoist out of common
Boost::headers
# Database support needs these two
nanodbc # for now; maybe hoist out of common
Boost::locale
${CURL_LIBRARIES}
${wxWidgets_LIBRARIES}
${EXTRA_LIBS}

View File

@ -19,9 +19,6 @@
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
list( APPEND BOOST_REQUESTED_COMPONENTS unit_test_framework system )
find_package( Boost 1.71.0 REQUIRED COMPONENTS ${BOOST_REQUESTED_COMPONENTS} )
include(KiCadQABuildUtils)
if( KICAD_TEST_XML_OUTPUT )

View File

@ -174,7 +174,7 @@ add_library(nanodbc
nanodbc/nanodbc.cpp
nanodbc/nanodbc.h)
target_link_libraries(nanodbc ${Boost_LIBRARIES} ${ODBC_LIBRARIES})
target_link_libraries(nanodbc Boost::locale ${ODBC_LIBRARIES})
if(APPLE)
target_link_libraries(nanodbc ${ODBC_LINK_FLAGS})