]> de.git.xonotic.org Git - xonotic/netradiant.git/commit - library-bundler
bundle: store dll in lib subdirectory, bundle all of them at once 136/head
authorThomas Debesse <dev@illwieckz.net>
Wed, 19 Jun 2019 18:45:53 +0000 (20:45 +0200)
committerThomas Debesse <dev@illwieckz.net>
Wed, 19 Jun 2019 19:03:34 +0000 (21:03 +0200)
commit7962186b3f0f9089370dacf832995c3e417b259d
treee3f0cb192040168bf8c412059c5abe152c9a57c2
parent423f9fcd57a3c844ed38b7a0a2ff23cbdb7eaa66
bundle: store dll in lib subdirectory, bundle all of them at once

instead of finding and copying the dll each time a binary is produced,
the path of the produced binary is stored in a unique file (to avoid race
condition) and the target for that binary is added as a dependency to a new
target named `bundle` that does the finding and the copying once for all.

this avoids race condition while building targets in parallel, workaround
the inability of cmake to track a common list between all targets and to keep
it from configure to build step

this makes the bundle process more reliable and avoid things being copied
twice. Before that I've seen copy processes starting to copy the same file
even with the -n option telling to not copy if the file exists, then seeing
one of them failing because they both started when the file was not yet
copied but one finished the copy before the other one

this also makes the bundling faster by only doing things once for all

the dll are then moved to a lib/ subdirectory instead of the root
of the buld directory

each binary having dll to find and copy is built with a special resource file
embedding a manifest telling there is an assembly directory containing dll
named lib, then a manifest is writen for that assembly directory listing all
the dll it can find there telling windows to look for them there at binary
loading instead of the system directory and the place right to binary

this:

- helps to ensure the right dll is loaded even if another exists
  with the same name on the system
- reduce the mess by storing all dll in one dedicated directory
- avoids the double cmake configure run by removing the need to
  glob the build directory before installation
CMakeLists.txt
README.md
bundle/CMakeLists.txt [new file with mode: 0644]
include/lib.rc [new file with mode: 0644]
library-bundler
radiant/CMakeLists.txt