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