From e558b0741a56330b476f2324a6b65fa0e81d467d Mon Sep 17 00:00:00 2001 From: Dmitry Arkhipov Date: Fri, 14 Jun 2024 21:56:05 +0300 Subject: [PATCH] add dlldir installation directory for shared libraries --- .github/workflows/ci.yml | 2 +- boost-install-dirs.jam | 1 + boost-install.jam | 40 ++++++++++++++++++++++++++++++++-------- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d947617..b9abe1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -585,7 +585,7 @@ jobs: cd tools\boost_install\test\${{matrix.lib}} mkdir __build__ && cd __build__ cmake -DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\..\.local -DUSE_BOOST_PACKAGE=1 -DBoost_VERBOSE=ON ${{matrix.copts}} .. - PATH %PATH%;%GITHUB_WORKSPACE%\..\.local\lib;%GITHUB_WORKSPACE%\..\boost-root\stage\lib + PATH %PATH%;%GITHUB_WORKSPACE%\..\.local\bin;%GITHUB_WORKSPACE%\..\boost-root\stage\bin cmake --build . --config Debug && cmake --build . --config Debug --target check cmake --build . --config Release && cmake --build . --config Release --target check cmake --build . --config MinSizeRel && cmake --build . --config MinSizeRel --target check diff --git a/boost-install-dirs.jam b/boost-install-dirs.jam index 5985152..61fd662 100644 --- a/boost-install-dirs.jam +++ b/boost-install-dirs.jam @@ -9,6 +9,7 @@ import path ; import stage ; stage.add-install-dir cmakedir : cmake : libdir ; +stage.add-install-dir dlldir : "" : libdir ; # header-subdir diff --git a/boost-install.jam b/boost-install.jam index 0808ae1..37a7d76 100644 --- a/boost-install.jam +++ b/boost-install.jam @@ -1215,6 +1215,30 @@ rule install-subdir ( properties * ) return (libdir)/$(r:E=) ; } +rule os-dlldir ( properties * ) +{ + local loc = [ property.select : $(properties) ] ; + if $(loc) + { + return $(loc) ; + } + + local dll-dir = [ property.select : $(properties) ] ; + if $(dlldir) || [ option.get dlldir ] + { + return (dlldir) ; + } + + local os = [ property.select : $(properties) ] ; + os = $(os:G=) ; + if $(os:E=x) in windows cygwin + { + return (bindir) ; + } + + return (dlldir) ; +} + rule boost-install ( libraries * ) { .debug boost-install $(libraries) ; @@ -1243,16 +1267,9 @@ rule boost-install ( libraries * ) install install-libraries-static : $(libraries) : (libdir) on STATIC_LIB ; $(p).mark-target-as-explicit install-libraries-static ; - alias install-libraries-shared : install-libraries-shared- ; - alias install-libraries-shared : install-libraries-shared-cygwin : cygwin ; + install install-libraries-shared : $(libraries) : SHARED_LIB PDB on on @boost-install%os-dlldir ; $(p).mark-target-as-explicit install-libraries-shared ; - install install-libraries-shared- : $(libraries) : (libdir) SHARED_LIB PDB on on ; - $(p).mark-target-as-explicit install-libraries-shared- ; - - install install-libraries-shared-cygwin : $(libraries) : (bindir) SHARED_LIB PDB on on ; - $(p).mark-target-as-explicit install-libraries-shared-cygwin ; - install install-unprefixed-static : $(unprefixed) : STATIC_LIB @boost-install%install-subdir ; $(p).mark-target-as-explicit install-unprefixed-static ; @@ -1304,16 +1321,23 @@ if [ MATCH --prefix=(.*) : [ modules.peek : ARGV ] ] option.set datadir : ; option.set datarootdir : ; option.set cmakedir : ; + option.set dlldir : ; } if [ MATCH --exec-prefix=(.*) : [ modules.peek : ARGV ] ] { option.set bindir : ; option.set libdir : ; option.set cmakedir : ; + option.set dlldir : ; } if [ MATCH --libdir-prefix=(.*) : [ modules.peek : ARGV ] ] { option.set cmakedir : ; + option.set dlldir : ; +} +if [ MATCH --bindir-prefix=(.*) : [ modules.peek : ARGV ] ] +{ + option.set dlldir : ; } if [ MATCH --dataroot-prefix=(.*) : [ modules.peek : ARGV ] ] {