From 2bf9d234aac30ed4a85282730da0ffc83acf9adf Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 3 Jun 2025 17:10:49 +0800 Subject: Use LL's prebuilt Windows Boost for now I got "definition of dllimport function not allowed" errors when using vcpkg's Boost. Someone else got this problem too: https://github.com/boostorg/serialization/issues/278 Hopefully later we can get back to using vcpkg's Boost. --- indra/cmake/Boost.cmake | 52 +++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 25 deletions(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 9ea1f6c9a6..2c4ec193e7 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -4,38 +4,40 @@ include(Prebuilt) include_guard() add_library( ll::boost INTERFACE IMPORTED ) - -if (DARWIN) - 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) - set(sfx -mt) -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 () -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() endif() +if (WINDOWS) use_prebuilt_binary(boost) + target_include_directories( ll::boost SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) +else () + if (DARWIN) + 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) + set(sfx -mt) + 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 () + 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 () # As of sometime between Boost 1.67 and 1.72, Boost libraries are suffixed # with the address size. -- cgit v1.2.3 From 4497b343cb96b12567f2eedfa93d33d0a5b66f76 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 4 Jun 2025 18:09:06 +0800 Subject: Revert "Use LL's prebuilt Windows Boost for now" This reverts commit 2bf9d234aac30ed4a85282730da0ffc83acf9adf. --- indra/cmake/Boost.cmake | 52 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 2c4ec193e7..9ea1f6c9a6 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -4,40 +4,38 @@ include(Prebuilt) include_guard() add_library( ll::boost INTERFACE IMPORTED ) + +if (DARWIN) + 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) + set(sfx -mt) +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 () +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() endif() -if (WINDOWS) use_prebuilt_binary(boost) - target_include_directories( ll::boost SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) -else () - if (DARWIN) - 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) - set(sfx -mt) - 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 () - 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 () # As of sometime between Boost 1.67 and 1.72, Boost libraries are suffixed # with the address size. -- cgit v1.2.3 From 7be4892f658d2ac1a63c656bed4cb5628898be98 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 4 Jun 2025 22:15:10 +0800 Subject: Fix vcpkg Boost JSON linking errors The error was "definition of dllimport static data member not allowed", and not "definition of dllimport function not allowed" as mentioned in commit 2bf9d234aac30ed4a85282730da0ffc83acf9adf description. Basically there were about 5 offending files, and all had BOOST_JSON_REQUIRE_CONST_INIT in them. Not including json/src.hpp (that includes them among others), fixes those errors, but then there are definitions in them that are actually used by llsdjson. After doing so many searches, I came across this: https://stackoverflow.com/questions/3491990/c-definition-of-dllimport-static-data-member and just from the first paragraph in the accepted answer, I realised llsdjson can still have those definitions, just not from the offending headers, but by simply linking to Boost JSON compiled library instead. --- indra/cmake/Boost.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 9ea1f6c9a6..764019408b 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -20,6 +20,7 @@ target_link_libraries( ll::boost INTERFACE boost_context${sfx} boost_fiber${sfx} boost_filesystem${sfx} + boost_json${sfx} boost_program_options${sfx} boost_regex${sfx} boost_system${sfx} -- cgit v1.2.3 From 628c200400dc9aa687c06a419d076a558651b1b9 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 4 Jun 2025 22:25:29 +0800 Subject: No link to vcpkg absent Boost Regex library file --- indra/cmake/Boost.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 764019408b..df5f05a200 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -22,11 +22,13 @@ target_link_libraries( ll::boost INTERFACE boost_filesystem${sfx} boost_json${sfx} boost_program_options${sfx} - boost_regex${sfx} boost_system${sfx} boost_thread${sfx} boost_url${sfx} ) +if (NOT WINDOWS) + target_link_libraries( ll::boost INTERFACE boost_regex${sfx}) +endif () target_compile_definitions( ll::boost INTERFACE BOOST_BIND_GLOBAL_PLACEHOLDERS ) return() -- cgit v1.2.3 From 990a8291bd89a4f46464a24a07fe965659f6fa52 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 5 Jun 2025 14:04:32 +0800 Subject: Only Windows link to Boost JSON library file Adding another library file to link means adding many more lines for other platform(s), at least for macOS with its bundling. It's much simpler to make the condition on 2 files. --- indra/cmake/Boost.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index df5f05a200..5a9e10b38b 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -20,13 +20,14 @@ target_link_libraries( ll::boost INTERFACE boost_context${sfx} boost_fiber${sfx} boost_filesystem${sfx} - boost_json${sfx} boost_program_options${sfx} boost_system${sfx} boost_thread${sfx} boost_url${sfx} ) -if (NOT WINDOWS) +if (WINDOWS) + target_link_libraries( ll::boost INTERFACE boost_json${sfx}) +else () target_link_libraries( ll::boost INTERFACE boost_regex${sfx}) endif () target_compile_definitions( ll::boost INTERFACE BOOST_BIND_GLOBAL_PLACEHOLDERS ) -- cgit v1.2.3 From 603589fde0ad81fc3687ecda0b046fb1f5260053 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 23 Jun 2025 06:58:01 +0800 Subject: Fix the vcpkg Boost libraries suffix on Win arm64 --- indra/cmake/Boost.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 5a9e10b38b..8459214f59 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -12,7 +12,11 @@ if (DARWIN) 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) + if ($ENV{MSYSTEM_CARCH} MATCHES aarch64) + set(sfx -vc143-mt-a64-1_88) + else () + set(sfx -vc143-mt-x64-1_88) + endif () else () find_package( Boost REQUIRED ) endif () -- cgit v1.2.3