From 387b63909bd5dabc125cbe092eb33a29cb26c2db Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Thu, 22 Aug 2024 23:59:27 +0100 Subject: [PATCH] Remove vestigial Boost libraries Boost::zlib is basically part of Boost::iostreams, and depending on how you configure Boost, it can either be a separate library or get embedded into iostreams. With the third-party-but-linked-on-Boost's-website package we've been using for years, it's a separate library. Before https://gitlab.com/OpenMW/openmw/-/merge_requests/4307, we needed to explicitly link with it as CMake wasn't handling transitive dependencies for us. With vcpkg, it's embedded, and doesn't have its own CMake config, so we couldn't explicitly link with it even if we wanted to. Now CMake *is* handling transitive dependencies for us, we don't even need to think about this library. It's all automatic. Boost::locale, on the other hand, used to be something we used directly (I think for doing UTF-16/UTF-8 conversions when dealing with Windows paths). However, it isn't anymore, and we just didn't purge it from our CMake when we should have. It can go. --- CMakeLists.txt | 8 -------- apps/mwiniimporter/CMakeLists.txt | 2 -- apps/opencs/CMakeLists.txt | 1 - components/CMakeLists.txt | 6 ------ components/platform/file.win32.cpp | 1 - 5 files changed, 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9770a05606..75b9642c5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -451,14 +451,6 @@ if(HAVE_MULTIVIEW) endif(HAVE_MULTIVIEW) set(BOOST_COMPONENTS iostreams program_options system) -if(WIN32) - set(BOOST_COMPONENTS ${BOOST_COMPONENTS} locale) - if(MSVC) - # boost-zlib is not present (nor needed) in vcpkg version of boost. - # there, it is part of boost-iostreams instead. - set(BOOST_OPTIONAL_COMPONENTS zlib) - endif(MSVC) -endif(WIN32) find_package(Boost 1.70.0 CONFIG REQUIRED COMPONENTS ${BOOST_COMPONENTS} OPTIONAL_COMPONENTS ${BOOST_OPTIONAL_COMPONENTS}) diff --git a/apps/mwiniimporter/CMakeLists.txt b/apps/mwiniimporter/CMakeLists.txt index 57a28bed9b..ed88ac0bc4 100644 --- a/apps/mwiniimporter/CMakeLists.txt +++ b/apps/mwiniimporter/CMakeLists.txt @@ -19,8 +19,6 @@ target_link_libraries(openmw-iniimporter ) if (WIN32) - target_link_libraries(openmw-iniimporter - Boost::locale) INSTALL(TARGETS openmw-iniimporter RUNTIME DESTINATION ".") endif(WIN32) diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index ce85b2fd19..87b1821cba 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -255,7 +255,6 @@ else() endif() if (WIN32) - target_link_libraries(openmw-cs-lib Boost::locale) target_sources(openmw-cs PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/openmw-cs.exe.manifest) endif() diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 70b1eb90a2..0b0dd7760b 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -614,12 +614,6 @@ endif() target_link_libraries(components ${BULLET_LIBRARIES}) -if (WIN32) - target_link_libraries(components - Boost::locale - Boost::zlib) -endif() - if (USE_QT) add_library(components_qt STATIC ${COMPONENT_QT_FILES} ${ESM_UI_HDR}) target_link_libraries(components_qt components Qt::Widgets Qt::Core) diff --git a/components/platform/file.win32.cpp b/components/platform/file.win32.cpp index f5ef60478b..3df99e8a8f 100644 --- a/components/platform/file.win32.cpp +++ b/components/platform/file.win32.cpp @@ -1,6 +1,5 @@ #include "file.hpp" -#include #include #include #include