From f5ab6e11f13699c03a696611f67f8384434130a1 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 13 May 2025 10:22:54 +0800 Subject: Not rely on (LL_)USESYSTEMLIBS macro & CMake setting but the fact that we keep on using as many system libraries as we can (and only resort to other sources in certain cases), hasn't changed, of course. Also stop having to set USE_AUTOBUILD_3P to OFF. Lines are reindented, and when a system library can be found for a dependency, then that should be the way. If later we find out that using some other way is better, than stick to that. So, one option at a time, whichever is best for the situation. GLEXT hasn't been used, and in order to be not having to hack its .cmake file, we bypass it and refer to GLH (which is still used) right away in LLWindow. CMake commands that need to be bypassed, if it's a one-liner then it's just commented out, but if it's multiple lines, then scope them with if (FALSE) to minimise difference. --- indra/cmake/Boost.cmake | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index c9688d0fe0..ba2eaccf63 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -4,34 +4,35 @@ include(Prebuilt) include_guard() add_library( ll::boost INTERFACE IMPORTED ) + +if (DARWIN) + set(sfx -mt) + target_include_directories( ll::boost SYSTEM INTERFACE /opt/local/libexec/boost/1.87/include) + target_link_directories( ll::boost INTERFACE /opt/local/libexec/boost/1.87/lib) +elseif (WINDOWS) + set(sfx -mt) + target_include_directories( ll::boost SYSTEM INTERFACE /opt/local/x86_64-w64-mingw32/include) + target_link_directories( ll::boost INTERFACE /opt/local/x86_64-w64-mingw32/lib) +else () + find_package( Boost REQUIRED ) +endif () +target_link_libraries( ll::boost INTERFACE + boost_context${sfx} + boost_fiber${sfx} + boost_filesystem${sfx} + boost_program_options${sfx} + boost_regex${sfx} + boost_system${sfx} + boost_thread${sfx} + boost_url${sfx} + ) +target_compile_definitions( ll::boost INTERFACE BOOST_BIND_GLOBAL_PLACEHOLDERS ) +return() + if( USE_CONAN ) target_link_libraries( ll::boost INTERFACE CONAN_PKG::boost ) target_compile_definitions( ll::boost INTERFACE BOOST_ALLOW_DEPRECATED_HEADERS BOOST_BIND_GLOBAL_PLACEHOLDERS ) return() -elseif( NOT USE_AUTOBUILD_3P ) - if (WINDOWS) - set(sfx -mt) - target_include_directories( ll::boost SYSTEM INTERFACE /opt/local/x86_64-w64-mingw32/include) - target_link_directories( ll::boost INTERFACE /opt/local/x86_64-w64-mingw32/lib) - elseif (DARWIN) - set(sfx -mt) - target_include_directories( ll::boost SYSTEM INTERFACE /opt/local/libexec/boost/1.87/include) - target_link_directories( ll::boost INTERFACE /opt/local/libexec/boost/1.87/lib) - else (WINDOWS) - find_package( Boost REQUIRED ) - endif (WINDOWS) - target_link_libraries( ll::boost INTERFACE - boost_context${sfx} - boost_fiber${sfx} - boost_filesystem${sfx} - boost_program_options${sfx} - boost_regex${sfx} - boost_system${sfx} - boost_thread${sfx} - boost_url${sfx} - ) - target_compile_definitions( ll::boost INTERFACE BOOST_BIND_GLOBAL_PLACEHOLDERS ) - return() endif() use_prebuilt_binary(boost) -- cgit v1.2.3 From 7ecde89008f9ed39c357b606d3bc231ba4360ee2 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 27 May 2025 10:01:21 +0800 Subject: Pass configuration phase with vcpkg replacing MSYS2 I happen to be using just Git Bash for convenience for running the commands on the Windows build instructions, hence the build folder pattern to be ignored from the result of running `uname -s` there. The instructions omit the part where you install vcpkg and set the VCPKG_ROOT environment variable, cause it depends on where you install vcpkg to your liking, but the next commands will rely on that variable being set correctly. The CMake used here is MS VS 2022 Community Edition's one, since it will know where the C++ compiler is. $VCPKG_ROOT/downloads/tools/msys2/21caed2f81ec917b/mingw64/bin is where pkg-config.exe can be found. $VCPKG_ROOT/installed/`uname -m|sed 's/86_//'`-windows/tools/libxml2 is where xmllint.exe can be found (from libxml2[tools]). PKG_CONFIG_LIBDIR and PYTHON environment settings are pretty self-explanatory. The flags set on LL_BUILD are now for Visual C++ and not MinGW(64)'s GCC or Clang any more, and copied from most of the flags in the variables file from LL's build-variables repo. vcpkg's apr & apr-util packages don't seem to install their .pc files, hence the manual target_include/link_directories/libraries settings, relying on some automatically generated INTERNAL CMake variable called prefix_result. vcpkg's Boost needs the same treatment, plus some suffix. We still use LL's prebuilt libs for OpenSSL, libcurl and WebRTC. Actually too for ColladaDOM for now, but we prepare Windows ColladaDOM self-building for later. For GLM and Meshoptimizer too, it's just the checking that's skipped otherwise it would fail (but the vcpkg packages can be used). Visual C++ doesn't recognise the no-deprecated-declarations compile option. On Visual C++, the macro to denote x86-64 seems to be _M_X64 (if not added there, it would try to find sse2neon :)) We still aren't using Autobuild here for Windows either, hence the FALSE-d viewer_manifest.py based file bundling. --- indra/cmake/Boost.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index ba2eaccf63..9ea1f6c9a6 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -6,13 +6,13 @@ include_guard() add_library( ll::boost INTERFACE IMPORTED ) if (DARWIN) - set(sfx -mt) target_include_directories( ll::boost SYSTEM INTERFACE /opt/local/libexec/boost/1.87/include) target_link_directories( ll::boost INTERFACE /opt/local/libexec/boost/1.87/lib) -elseif (WINDOWS) set(sfx -mt) - target_include_directories( ll::boost SYSTEM INTERFACE /opt/local/x86_64-w64-mingw32/include) - target_link_directories( ll::boost INTERFACE /opt/local/x86_64-w64-mingw32/lib) +elseif (WINDOWS) + target_include_directories( ll::boost SYSTEM INTERFACE ${prefix_result}/../include) + target_link_directories( ll::boost INTERFACE ${prefix_result}) + set(sfx -vc143-mt-x64-1_88) else () find_package( Boost REQUIRED ) endif () -- cgit v1.2.3