11#USING MSYS2 (WINDOWS) CMAKE, MESON, CONFIGURE
22
3- Created 6 October 2023
3+ Created 7 October 2023
44
55msys2 provides an environment much like posix/unix/linux
66with programs precompiled for use on windows
@@ -17,34 +17,42 @@ library libdwarf.a is not supported. A static
1717libdwarf.a can be built with meson or cmake.
1818
1919### Shared library builds
20- All libdwarf builds are automatically shared object (dll)
21- builds as of 0.8.0.
20+ Libdwarf builds from configure
21+ and cmake are static (archive) library builds
22+ by default.
23+ Meson builds to a shared library by default.
2224
23- With
25+ On msys2 with cmake one can generate a shared library
26+ build with:
27+
28+ -DBUILD_SHARED=YEs -DBUILD_NON_SHARED=NO
2429
25- --default-library static
2630
27- on the meson command line
31+ With the following on the meson command line
2832one can build libdwarf as an archive and dwarfdump and the
2933programs built will use the static library.
3034
31- The default is shared and can be explicitly
35+ --default-library static
36+
37+
38+ The meson default is shared and can be explicitly
3239chosen by:
3340
3441 --default-library shared
3542
36- Has the same meson setup reporting as on Linux (above).
37-
3843configure will only allow generation of shared library
3944builds, while for cmake and meson one can choose
40- wither to build a shared library or an archive library
45+ whether to build a shared library or a static ( archive) library
4146(libdwarf.a).
4247
48+ On msys2 with configure one gets a shared library build with:
49+
50+ --enable-shared --disable-static
4351
4452### NOTE on linking against libdwarf.a
4553
4654If you are are linking code against a static
47- library libdwarf.a you must arrange to define the
55+ library libdwarf.a you must arrange to define the
4856macro LIBDWARF_STATIC in compiling your code that
4957does a #include "libdwarf.h".
5058
@@ -86,30 +94,27 @@ building and testing all the build mechanisms:
8694 pacman -S mingw-w64-x86_64-cmake
8795 pacnam -S mingw-w64-x86_64-python3-pip
8896
89- To create a distribution
97+ To create a distribution one needs xz:
9098 pacman -S mingw-w64-x86_64-xz
9199
92100 to list packages
93101 pacman -Q
94102 to remove packages
95103 pacman -R <packagename>
96104
97- ## cmake specific
105+ ## Ninja speed
106+
98107cmake will generate ninja makefiles by default, add
99108'-G "Unix Makefiles"' to the cmake command line to
100109generate makefiles for gnu make, but we suggest you
101110use "-G Ninja" for speed and clarity..
102111
103- Use
104- -DBUILD_SHARED: BOOL =TRUE \
105- -DBUILD_NON_SHARED: BOOL =FALSE
106- on the cmake command
107- to be consistent with normal Windows use.
112+ ## Set a Prefix for test installs
108113
109114To get a usable set of executables
110115set a prefix (for cmake,
111- -DCMAKE_INSTALL_PREFIX=/c/msys64/usr),
112- presuming the bin directory
116+ -DCMAKE_INSTALL_PREFIX=$HOME/bin
117+ presuming the bin directory
113118is something in your $PATH in msys2.
114119Set an appropriate prefix whichever
115120build tool you use.
0 commit comments