|
| 1 | +Instructions for building libsigc++ on Visual Studio |
| 2 | += |
| 3 | + |
| 4 | +Building libsigc++ on Windows is now supported using Visual Studio |
| 5 | +versions 2017 or later in both 32-bit and 64-bit (x64 and ARM64) flavors, |
| 6 | +via NMake Makefiles. Due to `C++17` usage, Visual Studio 2015 or |
| 7 | +earlier is not supported, and any use of the headers installed with |
| 8 | +this package will require the use of the `/std:c++17` compiler flag. |
| 9 | + |
| 10 | +libsigc++ itself has no external dependencies, but building the |
| 11 | +benchmark test program will require an installation of the Boost |
| 12 | +C++ libraries. |
| 13 | + |
| 14 | +Building with NMake |
| 15 | +- |
| 16 | +The following describes what items are built with the following |
| 17 | +targets: |
| 18 | + |
| 19 | +* `all`, `examples`: (or no target specified): The libsigc++ DLL and the example programs. |
| 20 | +* `tests`: The libsigc++ DLL and the test programs. |
| 21 | +* `benchmark`: The libsigc++ DLL and the benchmark program, the Boost C++ headers should be found in one of the paths that are in`%INCLUDE%`. |
| 22 | + |
| 23 | +Building directly from a GIT checkout is now supported, provided that a `PERL` |
| 24 | +installation is present (pass the `PERL` interpreter executable in your NMake |
| 25 | +command line by using `nmake /f Makefile.vc ... PERL=<path_to_PERL_interpreter_executable>` by using |
| 26 | +the `prep-git-build` target. |
| 27 | + |
| 28 | +The following are instructions for performing such a build. A `clean` target is |
| 29 | +provided-it is recommended that one cleans the build and redo the build if any |
| 30 | +configuration option changed. An `install` target is also provided to copy the built |
| 31 | +items in their appropriate |
| 32 | +locations under `$(PREFIX)`, which is described below. |
| 33 | + |
| 34 | +Invoke the build by issuing the command: |
| 35 | +`nmake /f Makefile.vc CFG=[release|debug] [PREFIX=...] <option1=1 option2=1 ...>` |
| 36 | +where: |
| 37 | + |
| 38 | +* `CFG`: Required. Choose from a `release` or `debug` build. Note that |
| 39 | + all builds generate a `.pdb` file for each `.dll` and `.exe` built. |
| 40 | + |
| 41 | +* `PREFIX`: Optional. Base directory of where the third-party headers, libraries |
| 42 | +and needed tools can be found, i.e. headers in `$(PREFIX)\include`, |
| 43 | +libraries in `$(PREFIX)\lib` and tools and DLLs in `$(PREFIX)\bin`. If not |
| 44 | +specified, `$(PREFIX)` is set as `$(srcroot)\..\vs$(X)\$(platform)`, where |
| 45 | +`$(platform)` is `win32` for 32-bit builds or `x64` for 64-bit (Intel/AMD) |
| 46 | +builds or `arm64` for 64-bit (ARM) builds, and `$(X)` is the short version of the |
| 47 | +Visual Studio used, as follows: |
| 48 | + * 2017: `15` |
| 49 | + * 2019: `16` |
| 50 | + * 2022: `17` |
| 51 | + |
| 52 | +* `USE_COMPAT_LIBS`: Build the libsigc++ DLL and .lib with the filename |
| 53 | +`sigc-vc150(d)-3_0` for all builds. This is for compatibility reasons, |
| 54 | +if re-building dependent code is not convenient, for instance |
| 55 | + |
| 56 | +* Options, set by `<option>=1`: |
| 57 | + |
| 58 | + * `BOOST_DLL`: When building the benchmark, link to a DLL build of the Boost |
| 59 | +libraries. Required if your installation of the Boost libraries are built as DLLs. |
| 60 | +Note that debug builds must link to debug builds of Boost and release builds must |
| 61 | +link to release builds of Boost. |
| 62 | + |
| 63 | + * `STATIC`: Optional. Set if building libsigc++ as a static library. Note that |
| 64 | +for building items that use this static build, `/DLIBSIGCXX_STATIC` |
| 65 | +must be passed into the compiler flags. |
0 commit comments