From b863edbe85b839ec14f468af4aebe5d6e51af380 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 4 Jan 2023 10:53:56 +0100 Subject: [PATCH 01/60] Meson build: Don't copy files with configure_file() It's deprecated from Meson 0.64. The replacement, fs.copyfile(), is not useful here. It only copies from the source directory to the build directory. --- MSVC_NMake/meson.build | 8 ++++---- meson.build | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/MSVC_NMake/meson.build b/MSVC_NMake/meson.build index 09078b3..f11412a 100644 --- a/MSVC_NMake/meson.build +++ b/MSVC_NMake/meson.build @@ -1,6 +1,6 @@ # MSVC_NMake -# Input: pkg_conf_data, sigcxxconfig_h, project_build_root, python3, +# Input: pkg_conf_data, sigcxxconfig_h_meson, project_build_root, python3, # can_add_dist_script # Output: sigc_rc @@ -10,11 +10,11 @@ sigc_rc = configure_file( configuration: pkg_conf_data, ) -# Copy the generated configuration header into the MSVC project directory. +# Make a copy of the generated configuration header in the MSVC project directory. configure_file( - input: sigcxxconfig_h, + input: sigcxxconfig_h_meson, output: 'sigc++config.h', - copy: true, + configuration: pkg_conf_data, ) untracked_msvc_nmake = 'untracked' / 'MSVC_NMake' diff --git a/meson.build b/meson.build index c677697..82920bf 100644 --- a/meson.build +++ b/meson.build @@ -241,9 +241,10 @@ configure_file( configuration: pkg_conf_data, ) +sigcxxconfig_h_meson = files('sigc++config.h.meson') install_includeconfigdir = install_libdir / sigcxx_pcname / 'include' -sigcxxconfig_h = configure_file( - input: 'sigc++config.h.meson', +configure_file( + input: sigcxxconfig_h_meson, output: 'sigc++config.h', configuration: pkg_conf_data, install_dir: install_includeconfigdir, From 91441e49653721053c50e3dfadb591de8592cd93 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 4 Jan 2023 10:56:31 +0100 Subject: [PATCH 02/60] meson.build: Fix the evaluation of is_git_build on Windows See gtkmm#131 --- meson.build | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 82920bf..9f7627d 100644 --- a/meson.build +++ b/meson.build @@ -47,12 +47,17 @@ python3 = find_program('python3', version: '>=3.5') # Suppose we do if and only if the meson.build file is tracked by git. cmd_py = ''' import shutil, subprocess, sys -if not shutil.which('git'): +git_exe = shutil.which('git') +if not git_exe: sys.exit(1) -cmd = [ 'git', 'ls-files', '--error-unmatch', 'meson.build' ] -sys.exit(subprocess.run(cmd, cwd="@0@", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode) -'''.format(project_source_root) -is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() == 0 +cmd = [ git_exe, 'ls-files', '--error-unmatch', 'meson.build' ] +sys.exit(subprocess.run(cmd, cwd=sys.argv[1], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode) +''' +is_git_build = run_command( + python3, '-c', cmd_py, + project_source_root, + check: false, +).returncode() == 0 # Are we testing a dist tarball while it's being built? # There ought to be a better way. https://github.com/mesonbuild/meson/issues/6866 From 9fc3416a95abca28cb992e4607232a3287e847a1 Mon Sep 17 00:00:00 2001 From: Francesco Emanuele D'Agostino Date: Sun, 15 Jan 2023 00:46:51 +0100 Subject: [PATCH 03/60] introducing protection to prevent multiple target declaration for uninstall. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2151377..5741400 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,7 @@ set (top_srcdir .) configure_file (sigc++.pc.in sigc++-${SIGCXX_API_VERSION}.pc @ONLY) configure_file (sigc++-uninstalled.pc.in sigc++-${SIGCXX_API_VERSION}-uninstalled.pc @ONLY) +if (NOT TARGET uninstall) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" @@ -72,7 +73,7 @@ configure_file( add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) - +endif() install (FILES "${CMAKE_CURRENT_BINARY_DIR}/sigc++config.h" From 550e91d6c565deb5bf144f8d82f5dbdbeb75f412 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 3 Apr 2023 11:17:59 +0200 Subject: [PATCH 04/60] meson.build: Simplify if-file-exists test --- meson.build | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index 9f7627d..e4630fe 100644 --- a/meson.build +++ b/meson.build @@ -137,17 +137,9 @@ if maintainer_mode project_source_root / 'untracked' / 'docs' / 'docs', check: true, ) -else - cmd_py = ''' -import os -import sys -sys.exit(os.path.isfile("@0@")) -'''.format(doc_reference) - file_exists = run_command(python3, '-c', cmd_py, check: false).returncode() != 0 - if not file_exists - warning('Missing files in untracked/. ' + \ - 'Enable maintainer-mode if you want to build documentation or create a dist tarball.') - endif +elif not import('fs').is_file(doc_reference) + warning('Missing files in untracked/.\n ' + \ + 'Enable maintainer-mode if you want to build documentation or create a dist tarball.') endif # Check if perl is required and available. From 2ef3e5269f44c4664a90ec04f3c2c0a7382800c1 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 3 Apr 2023 11:18:19 +0200 Subject: [PATCH 05/60] README.md, CI: meson -> meson setup --- .github/workflows/meson-clang-10.yml | 2 +- .github/workflows/meson-gcc-10.yml | 2 +- .github/workflows/publish-docs.yml | 2 +- README.md | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/meson-clang-10.yml b/.github/workflows/meson-clang-10.yml index adab196..092c00e 100644 --- a/.github/workflows/meson-clang-10.yml +++ b/.github/workflows/meson-clang-10.yml @@ -19,7 +19,7 @@ jobs: # Install it with pip3 instead of apt. sudo pip3 install "meson>=0.55.0" export CXX=clang++-10 - meson -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build + meson setup -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build cd _build meson compile - name: Test diff --git a/.github/workflows/meson-gcc-10.yml b/.github/workflows/meson-gcc-10.yml index 46cc6b5..d358d7f 100644 --- a/.github/workflows/meson-gcc-10.yml +++ b/.github/workflows/meson-gcc-10.yml @@ -19,7 +19,7 @@ jobs: # Install it with pip3 instead of apt. sudo pip3 install "meson>=0.55.0" export CXX=g++-10 - meson -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build + meson setup -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build cd _build meson compile - name: Test diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 35434f8..95b0a6f 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -38,7 +38,7 @@ jobs: export ENV DEBIAN_FRONTEND=noninteractive sudo apt update sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++ meson ninja-build python3-setuptools python3-pip --yes - meson -Dbuild-documentation=true -Dbuild-examples=false -Dbuild-tests=false _build + meson setup -Dbuild-documentation=true -Dbuild-examples=false -Dbuild-tests=false _build meson compile -C _build - name: Collect Documentation # Collect all documentation to be published. diff --git a/README.md b/README.md index 5ffed35..dfc32e9 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,10 @@ For instance: ```sh # If the tarball was made with Autotools, and you want to rebuild the reference # documentation, you must enable maintainer-mode: -$ meson --prefix=/some_directory --libdir=lib -Dmaintainer-mode=true your_builddir . +$ meson setup --prefix=/some_directory --libdir=lib -Dmaintainer-mode=true your_builddir . # If the tarball was made with Meson, or you don't want to rebuild the docs: -$ meson --prefix=/some_directory --libdir=lib your_builddir . +$ meson setup --prefix=/some_directory --libdir=lib your_builddir . # then: $ cd your_builddir @@ -105,7 +105,7 @@ Don't call the builddir 'build'. There is a directory called 'build' with files used by Autotools. ```sh -$ meson --prefix=/some_directory --libdir=lib your_builddir . +$ meson setup --prefix=/some_directory --libdir=lib your_builddir . $ cd your_builddir $ ninja $ ninja install From e82dc27ae6c42301695be5a2b2df10e4f544a1f4 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 31 May 2023 18:35:45 +0200 Subject: [PATCH 06/60] sigc++.pc.in: Update htmlrefpub --- sigc++.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigc++.pc.in b/sigc++.pc.in index 05de315..16a5514 100644 --- a/sigc++.pc.in +++ b/sigc++.pc.in @@ -8,7 +8,7 @@ includedir=@includedir@ docdir=${datarootdir}/doc/libsigc++-@SIGCXX_API_VERSION@ doxytagfile=${docdir}/reference/libsigc++-@SIGCXX_API_VERSION@.tag htmlrefdir=${docdir}/reference/html -htmlrefpub=http://library.gnome.org/devel/libsigc++/unstable/ +htmlrefpub=https://libsigcplusplus.github.io/libsigcplusplus/reference/html/ Name: libsigc++ Description: Typesafe signal and callback system for C++ From 0e3724cd94ccd5da7c13c8169ce561bf02062d11 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 31 May 2023 18:36:39 +0200 Subject: [PATCH 07/60] Doxyfile.in: Remove obsolete entries --- docs/docs/reference/Doxyfile.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/docs/reference/Doxyfile.in b/docs/docs/reference/Doxyfile.in index c4cefda..0ffb9eb 100644 --- a/docs/docs/reference/Doxyfile.in +++ b/docs/docs/reference/Doxyfile.in @@ -224,7 +224,6 @@ PDF_HYPERLINKS = YES USE_PDFLATEX = YES LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO -LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain LATEX_TIMESTAMP = NO #--------------------------------------------------------------------------- @@ -236,7 +235,6 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = -RTF_SOURCE_CODE = NO #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- @@ -256,7 +254,6 @@ XML_PROGRAMLISTING = NO #--------------------------------------------------------------------------- GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- @@ -297,7 +294,6 @@ EXTERNAL_PAGES = YES #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES DIA_PATH = HIDE_UNDOC_RELATIONS = NO HAVE_DOT = YES From bc91a4f36ccece12c5e52e54f38e54f75b423c34 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 31 May 2023 18:36:58 +0200 Subject: [PATCH 08/60] connection: Improve the class documentation Fixes #88 --- sigc++/connection.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sigc++/connection.h b/sigc++/connection.h index 4b4926e..0e73376 100644 --- a/sigc++/connection.h +++ b/sigc++/connection.h @@ -25,7 +25,14 @@ namespace sigc { -/** This may be used to disconnect the referred slot at any time (disconnect()). +/** Convenience class for safe disconnection. + * + * This may be used to disconnect the referred slot at any time (disconnect()). + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" + * returns a %sigc::connection. + * @code + * sigc::connection conn = sig.connect(sigc::mem_fun(a, &A::foo)); + * @endcode * If the slot has already been destroyed, disconnect() does nothing. empty() or * operator bool() can be used to test whether the connection is * still active. The connection can be blocked (block(), unblock()). From b0312f2397536c48f1f015aa1e7ee6f014206c48 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 15:20:53 +0800 Subject: [PATCH 09/60] meson: Disallow default_library == 'both' on Visual Studio We need different defines/cflags for building static and shared builds of libsigc++, so we can't really support default_library = 'both' for libsigc++ without much retinkering. So, just disallow such builds at least for now. Also, save up whether we are attempting a static build in the Visual Studio build. --- meson.build | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/meson.build b/meson.build index e4630fe..3190d6e 100644 --- a/meson.build +++ b/meson.build @@ -43,6 +43,18 @@ cpp_compiler = meson.get_compiler('cpp') is_msvc = cpp_compiler.get_id() == 'msvc' python3 = find_program('python3', version: '>=3.5') +# MSVC: We currently do not support shared and static builds at the, +# same time, since we need different defines/cflags for proper +# linking. +if is_msvc + if get_option('default_library') == 'both' + error('-Ddefault_library=both is currently not supported for Visual Studio') + endif + is_msvc_static = get_option('default_library') == 'static' +else + is_msvc_static = false +endif + # Do we build from a git repository? # Suppose we do if and only if the meson.build file is tracked by git. cmd_py = ''' From a23cdc45176979bc1f4dda2e09c72ad2d619e476 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 15:22:10 +0800 Subject: [PATCH 10/60] build: Drop _WINDLL from sigc++config.h.[in|meson|cmake] ...and add a new check macro LIBSIGCXX_STATIC, to use the appropriate macros to build and link against libsigc++. Drop this from the build files as well. --- MSVC_NMake/config-msvc.mak | 2 +- sigc++/meson.build | 2 +- sigc++config.h.cmake | 6 ++++-- sigc++config.h.in | 4 +++- sigc++config.h.meson | 4 +++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/MSVC_NMake/config-msvc.mak b/MSVC_NMake/config-msvc.mak index 86ee18b..a8c5280 100644 --- a/MSVC_NMake/config-msvc.mak +++ b/MSVC_NMake/config-msvc.mak @@ -14,7 +14,7 @@ DEBUG_SUFFIX = -d DEBUG_SUFFIX = !endif -LIBSIGCPP_DEFINES = /DSIGC_BUILD /D_WINDLL +LIBSIGCPP_DEFINES = /DSIGC_BUILD SIGCPP_BASE_CFLAGS = /I.. /I. /I..\untracked\MSVC_NMake /std:c++17 /EHsc $(CFLAGS) diff --git a/sigc++/meson.build b/sigc++/meson.build index 9d9561f..3b3cfeb 100644 --- a/sigc++/meson.build +++ b/sigc++/meson.build @@ -74,7 +74,7 @@ extra_sigc_objects = [] # Make sure we are exporting the symbols from the DLL if is_msvc - extra_sigc_cppflags += ['-DSIGC_BUILD', '-D_WINDLL'] + extra_sigc_cppflags += ['-DSIGC_BUILD'] endif # Build the .rc file for Windows builds and link to it diff --git a/sigc++config.h.cmake b/sigc++config.h.cmake index 74d348a..2c7e943 100644 --- a/sigc++config.h.cmake +++ b/sigc++config.h.cmake @@ -16,7 +16,9 @@ # if defined(_MSC_VER) # define SIGC_MSC 1 # define SIGC_WIN32 1 -# define SIGC_DLL 1 +# ifndef LIBSIGCXX_STATIC +# define SIGC_DLL 1 +# endif # elif defined(__CYGWIN__) # define SIGC_CONFIGURE 1 # elif defined(__MINGW32__) @@ -54,7 +56,7 @@ #endif /* !SIGC_MSC */ #ifdef SIGC_DLL -# if defined(SIGC_BUILD) && defined(_WINDLL) +# ifdef SIGC_BUILD # define SIGC_API __declspec(dllexport) # elif !defined(SIGC_BUILD) # define SIGC_API __declspec(dllimport) diff --git a/sigc++config.h.in b/sigc++config.h.in index a82a86b..573bc36 100644 --- a/sigc++config.h.in +++ b/sigc++config.h.in @@ -16,7 +16,9 @@ #if defined(_MSC_VER) #define SIGC_MSC 1 #define SIGC_WIN32 1 +#ifndef LIBSIGCXX_STATIC #define SIGC_DLL 1 +#endif #elif defined(__CYGWIN__) #define SIGC_CONFIGURE 1 #elif defined(__MINGW32__) @@ -54,7 +56,7 @@ #endif /* !SIGC_MSC */ #ifdef SIGC_DLL -#if defined(SIGC_BUILD) && defined(_WINDLL) +#ifdef SIGC_BUILD #define SIGC_API __declspec(dllexport) #elif !defined(SIGC_BUILD) #define SIGC_API __declspec(dllimport) diff --git a/sigc++config.h.meson b/sigc++config.h.meson index 47cbd80..3027b26 100644 --- a/sigc++config.h.meson +++ b/sigc++config.h.meson @@ -19,7 +19,9 @@ #if defined(_MSC_VER) #define SIGC_MSC 1 #define SIGC_WIN32 1 +#ifndef LIBSIGCXX_STATIC #define SIGC_DLL 1 +#endif #elif defined(__CYGWIN__) #define SIGC_CONFIGURE 1 #elif defined(__MINGW32__) @@ -57,7 +59,7 @@ #endif /* !SIGC_MSC */ #ifdef SIGC_DLL -#if defined(SIGC_BUILD) && defined(_WINDLL) +#ifdef SIGC_BUILD #define SIGC_API __declspec(dllexport) #elif !defined(SIGC_BUILD) #define SIGC_API __declspec(dllimport) From 41b7d33007b53098aec388a6b6bc5a896b1d7c76 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 11:25:42 +0800 Subject: [PATCH 11/60] build: Actually support MSVC static builds Apply -DLIBSIGCXX_STATIC as appropriate when we request a static build to be done for the Meson and NMake builds, and skip building the version .rc file if a static build is requested. For the NMake builds, separate the build artifacts from the static and shared builds. The CMake builds are not updated here as it always assumes a shared build, nor are the autotools builds since it is not used for Visual Studio builds at all. --- MSVC_NMake/build-rules-msvc.mak | 39 +++++++++++++++++++------------- MSVC_NMake/config-msvc.mak | 19 ++++++++++++++++ MSVC_NMake/create-lists-msvc.mak | 37 +++++++++++++++++++++++++----- MSVC_NMake/info-msvc.mak | 8 ++++++- meson.build | 3 +++ sigc++/meson.build | 6 +++-- 6 files changed, 87 insertions(+), 25 deletions(-) diff --git a/MSVC_NMake/build-rules-msvc.mak b/MSVC_NMake/build-rules-msvc.mak index fe5a587..74e51d9 100644 --- a/MSVC_NMake/build-rules-msvc.mak +++ b/MSVC_NMake/build-rules-msvc.mak @@ -13,25 +13,25 @@ # $(CC)|$(CXX) $(cflags) /Fo$(destdir) /c @<< # $< # << -{..\sigc++\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\sigc\}.obj: +{..\sigc++\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\}.obj: @if not exist .\sigc++config.h if not exist ..\untracked\MSVC_NMake\sigc++config.h $(MAKE) /f Makefile.vc CFG=$(CFG) sigc++config.h @if not exist $(@D)\ md $(@D) $(CXX) $(LIBSIGCPP_CFLAGS) /Fo$(@D)\ /Fd$(@D)\ /c @<< $< << -{..\sigc++\functors\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\sigc\}.obj: +{..\sigc++\functors\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\}.obj: @if not exist .\sigc++config.h if not exist ..\untracked\MSVC_NMake\sigc++config.h $(MAKE) /f Makefile.vc CFG=$(CFG) sigc++config.h @if not exist $(@D)\ md $(@D) $(CXX) $(LIBSIGCPP_CFLAGS) /Fo$(@D)\ /Fd$(@D)\ /c @<< $< << -{.}.rc{vs$(VSVER)\$(CFG)\$(PLAT)\sigc\}.res: +{.}.rc{vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\}.res: @if not exist $(@D)\ md $(@D) rc /fo$@ $< -{..\untracked\MSVC_NMake\}.rc{vs$(VSVER)\$(CFG)\$(PLAT)\sigc\}.res: +{..\untracked\MSVC_NMake\}.rc{vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\}.res: @if not exist $(@D)\ md $(@D) rc /fo$@ $< @@ -42,13 +42,20 @@ $< # $(dependent_objects) # << # @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2 +!ifdef STATIC +$(LIBSIGC_LIB): $(libsigc_OBJS) + lib $(ARFLAGS) -out:$@ @<< +$(libsigc_OBJS) +<< +!else $(LIBSIGC_LIB): $(LIBSIGC_DLL) -$(LIBSIGC_DLL): $(sigc_dll_OBJS) +$(LIBSIGC_DLL): $(libsigc_OBJS) link /DLL $(LDFLAGS) /implib:$(LIBSIGC_LIB) -out:$@ @<< -$(sigc_dll_OBJS) +$(libsigc_OBJS) << @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2 +!endif # Rules for linking Executables # Format is as follows (the mt command is needed for MSVC 2005/2008 builds): @@ -65,13 +72,13 @@ clean: @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.ilk @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exp @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.lib - @-if exist vs$(VSVER)\$(CFG)\$(PLAT)\sigc-tests del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc-tests\*.obj - @-if exist vs$(VSVER)\$(CFG)\$(PLAT)\sigc-tests del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc-tests\*.pdb - @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc-examples\*.obj - @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc-examples\*.pdb - @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc\*.res - @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc\*.obj - @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc\*.pdb - @-if exist vs$(VSVER)\$(CFG)\$(PLAT)\sigc-tests rd vs$(VSVER)\$(CFG)\$(PLAT)\sigc-tests - @-rd vs$(VSVER)\$(CFG)\$(PLAT)\sigc-examples - @-rd vs$(VSVER)\$(CFG)\$(PLAT)\sigc + @-if exist vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_TESTS_INTDIR) del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_TESTS_INTDIR)\*.obj + @-if exist vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_TESTS_INTDIR) del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_TESTS_INTDIR)\*.pdb + @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_EX_INTDIR)\*.obj + @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_EX_INTDIR)\*.pdb + @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\*.res + @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\*.obj + @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\*.pdb + @-if exist vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_TESTS_INTDIR) rd vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_TESTS_INTDIR) + @-rd vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_EX_INTDIR) + @-rd vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR) diff --git a/MSVC_NMake/config-msvc.mak b/MSVC_NMake/config-msvc.mak index a8c5280..52c72a0 100644 --- a/MSVC_NMake/config-msvc.mak +++ b/MSVC_NMake/config-msvc.mak @@ -8,6 +8,16 @@ BASE_INCLUDES = /I$(PREFIX)\include LIBSIGC_MAJOR_VERSION = 3 LIBSIGC_MINOR_VERSION = 0 +!ifdef STATIC +LIBSIGC_INTDIR = sigc-static +SIGC_EX_INTDIR = sigc-examples-static +SIGC_TESTS_INTDIR = sigc-tests-static +!else +LIBSIGC_INTDIR = sigc +SIGC_EX_INTDIR = sigc-examples +SIGC_TESTS_INTDIR = sigc-tests +!endif + !if "$(CFG)" == "debug" || "$(CFG)" == "Debug" DEBUG_SUFFIX = -d !else @@ -18,6 +28,11 @@ LIBSIGCPP_DEFINES = /DSIGC_BUILD SIGCPP_BASE_CFLAGS = /I.. /I. /I..\untracked\MSVC_NMake /std:c++17 /EHsc $(CFLAGS) +# Define LIBSIGCXX_STATIC everywhere for static builds +!ifdef STATIC +SIGCPP_BASE_CFLAGS = $(SIGCPP_BASE_CFLAGS) /DLIBSIGCXX_STATIC +!endif + LIBSIGC_INT_SOURCES = $(sigc_sources_cc:/=\) LIBSIGC_INT_HDRS = $(sigc_public_h:/=\) @@ -35,8 +50,12 @@ LIBSIGC_LIBNAME = sigc-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(LIBSIGC_MAJOR_VERSION)_$( LIBSIGC_DLLNAME = $(LIBSIGC_LIBNAME) !endif +!ifdef STATIC +LIBSIGC_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_LIBNAME)-static.lib +!else LIBSIGC_DLL = vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_DLLNAME).dll LIBSIGC_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_LIBNAME).lib +!endif # If your Boost libraries are built as DLLs, use BOOST_DLL=1 in your NMake command line !ifdef BOOST_DLL diff --git a/MSVC_NMake/create-lists-msvc.mak b/MSVC_NMake/create-lists-msvc.mak index 2691d88..0689c89 100644 --- a/MSVC_NMake/create-lists-msvc.mak +++ b/MSVC_NMake/create-lists-msvc.mak @@ -35,18 +35,40 @@ NULL= # For libsigc++ -!if [call create-lists.bat header sigc.mak sigc_dll_OBJS] +!if [call create-lists.bat header sigc.mak libsigc_OBJS] !endif -!if [for %c in ($(sigc_sources_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file sigc.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc\%~nc.obj] +!if [for %c in ($(sigc_sources_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file sigc.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(LIBSIGC_INTDIR)\%~nc.obj] !endif -!if [@call create-lists.bat file sigc.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc\sigc.res] +# No point linking in version resource for static builds +!ifndef STATIC +!if [@call create-lists.bat file sigc.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(LIBSIGC_INTDIR)\sigc.res] +!endif !endif !if [call create-lists.bat footer sigc.mak] !endif +!ifdef STATIC +# start of static executables +!if [for %d in (examples tests) do @call create-lists.bat header sigc.mak libsigc_%d & @(for %s in (..\%d\*.cc) do @if not "%~ns" == "testutilities" if not "%~ns" == "benchmark" call create-lists.bat file sigc.mak vs$(VSVER)\$(CFG)\$(PLAT)\%~ns-static.exe) & @call create-lists.bat footer sigc.mak] +!endif + +!if [call create-lists.bat header sigc.mak libsigc_benchmark & @for %s in (..\tests\benchmark.cc) do @(call create-lists.bat file sigc.mak vs$(VSVER)\$(CFG)\$(PLAT)\%~ns-static.exe) & @call create-lists.bat footer sigc.mak] +!endif + +!if [for %d in (examples tests) do @for %s in (..\%d\*.cc) do @if not "%~ns" == "benchmark" echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc-%d-static\%~ns.obj: %s>>sigc.mak & @echo. @if not exist ^$(@D)\ md ^$(@D)>>sigc.mak & @echo. ^$(CXX) ^$(SIGCPP_CFLAGS) /Fo^$(@D)\ /Fd^$(@D)\ ^$** /c>>sigc.mak & @echo.>>sigc.mak] +!endif + +!if [for %s in (..\examples\*.cc) do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%~ns-static.exe: ^$(LIBSIGC_LIB) vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_EX_INTDIR)\%~ns.obj>>sigc.mak & @echo. link ^$(LDFLAGS) ^$** /out:^$@>>sigc.mak & @echo.>>sigc.mak] +!endif + +!if [for %s in (..\tests\*.cc) do @if not "%~ns" == "testutilities" echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%~ns-static.exe: ^$(LIBSIGC_LIB) vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_TESTS_INTDIR)\%~ns.obj vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_TESTS_INTDIR)\testutilities.obj>>sigc.mak & @echo. link ^$(LDFLAGS) ^$** /out:^$@>>sigc.mak & @echo.>>sigc.mak] +!endif +# end of static executables +!else +# start of shared executables !if [for %d in (examples tests) do @call create-lists.bat header sigc.mak libsigc_%d & @(for %s in (..\%d\*.cc) do @if not "%~ns" == "testutilities" if not "%~ns" == "benchmark" call create-lists.bat file sigc.mak vs$(VSVER)\$(CFG)\$(PLAT)\%~ns.exe) & @call create-lists.bat footer sigc.mak] !endif @@ -56,13 +78,16 @@ NULL= !if [for %d in (examples tests) do @for %s in (..\%d\*.cc) do @if not "%~ns" == "benchmark" echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc-%d\%~ns.obj: %s>>sigc.mak & @echo. @if not exist ^$(@D)\ md ^$(@D)>>sigc.mak & @echo. ^$(CXX) ^$(SIGCPP_CFLAGS) /Fo^$(@D)\ /Fd^$(@D)\ ^$** /c>>sigc.mak & @echo.>>sigc.mak] !endif -!if [for %s in (..\tests\benchmark.cc) do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc-tests\%~ns.obj: %s>>sigc.mak & @echo. @if not exist ^$(@D)\ md ^$(@D)>>sigc.mak & @echo. ^$(CXX) ^$(SIGCPP_BENCHMARK_CFLAGS) /Fo^$(@D)\ /Fd^$(@D)\ ^$** /c>>sigc.mak & @echo.>>sigc.mak] +!if [for %s in (..\examples\*.cc) do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%~ns.exe: ^$(LIBSIGC_LIB) vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_EX_INTDIR)\%~ns.obj>>sigc.mak & @echo. link ^$(LDFLAGS) ^$** /out:^$@>>sigc.mak & @echo.>>sigc.mak] +!endif + +!if [for %s in (..\tests\*.cc) do @if not "%~ns" == "testutilities" echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%~ns.exe: ^$(LIBSIGC_LIB) vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_TESTS_INTDIR)\%~ns.obj vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_TESTS_INTDIR)\testutilities.obj>>sigc.mak & @echo. link ^$(LDFLAGS) ^$** /out:^$@>>sigc.mak & @echo.>>sigc.mak] !endif -!if [for %s in (..\examples\*.cc) do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%~ns.exe: ^$(LIBSIGC_LIB) vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc-examples\%~ns.obj>>sigc.mak & @echo. link ^$(LDFLAGS) ^$** /out:^$@>>sigc.mak & @echo.>>sigc.mak] +# end of shared executables !endif -!if [for %s in (..\tests\*.cc) do @if not "%~ns" == "testutilities" echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%~ns.exe: ^$(LIBSIGC_LIB) vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc-tests\%~ns.obj vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc-tests\testutilities.obj>>sigc.mak & @echo. link ^$(LDFLAGS) ^$** /out:^$@>>sigc.mak & @echo.>>sigc.mak] +!if [for %s in (..\tests\benchmark.cc) do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_TESTS_INTDIR)\%~ns.obj: %s>>sigc.mak & @echo. @if not exist ^$(@D)\ md ^$(@D)>>sigc.mak & @echo. ^$(CXX) ^$(SIGCPP_BENCHMARK_CFLAGS) /Fo^$(@D)\ /Fd^$(@D)\ ^$** /c>>sigc.mak & @echo.>>sigc.mak] !endif !include sigc.mak diff --git a/MSVC_NMake/info-msvc.mak b/MSVC_NMake/info-msvc.mak index 30d1dba..76b2341 100644 --- a/MSVC_NMake/info-msvc.mak +++ b/MSVC_NMake/info-msvc.mak @@ -6,13 +6,15 @@ all-build-info: @echo Build info @echo --------- @echo Build Type: $(CFG) + @if not "$(STATIC)" == "" echo Library Build Type: static + @if "$(STATIC)" == "" echo Library Build Type: DLL help: @echo. @echo ============================== @echo Building libsigc++ Using NMake @echo ============================== - @echo nmake /f Makefile.vc CFG=[release^|debug] ^ + @echo nmake /f Makefile.vc CFG=[release^|debug] ^ ^ @echo. @echo Where: @echo ------ @@ -24,6 +26,10 @@ help: @echo where ^$(short_vs_ver) is 15 for VS 2017 and so on; and @echo ^$(platform) is Win32 for 32-bit builds and x64 for x64 builds. @echo. + @echo STATIC: Optional, enable to build static libsigc++. Define + @echo LIBSIGCXX_STATIC in the compiler flags to use the static build of + @echo libsigc++. + @echo. @echo ====== @echo A 'clean' target is supported to remove all generated files, intermediate @echo object files and binaries for the specified configuration. diff --git a/meson.build b/meson.build index 3190d6e..4777ed5 100644 --- a/meson.build +++ b/meson.build @@ -216,6 +216,9 @@ if is_msvc cpp_compiler.get_supported_arguments(disable_warnings_list), language: 'cpp' ) + if is_msvc_static + add_project_arguments(['-DLIBSIGCXX_STATIC'], language: 'cpp') + endif endif # Configure files diff --git a/sigc++/meson.build b/sigc++/meson.build index 3b3cfeb..d9c1231 100644 --- a/sigc++/meson.build +++ b/sigc++/meson.build @@ -80,8 +80,10 @@ endif # Build the .rc file for Windows builds and link to it if host_machine.system() == 'windows' windows = import('windows') - sigc_res = windows.compile_resources(sigc_rc) - extra_sigc_objects += sigc_res + if get_option('default_library') == 'shared' + sigc_res = windows.compile_resources(sigc_rc) + extra_sigc_objects += sigc_res + endif endif extra_include_dirs = ['..'] From b94f8396c154dcc2e3de1950c8873002f9b651ac Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 11:56:39 +0800 Subject: [PATCH 12/60] NMake Makefiles: Accomodate static builds during "install" Copy the built DLL and PDB only if building a shared build, and copy the appropriate .lib file according to the build type. --- MSVC_NMake/install.mak | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MSVC_NMake/install.mak b/MSVC_NMake/install.mak index f9f07e2..72b4402 100644 --- a/MSVC_NMake/install.mak +++ b/MSVC_NMake/install.mak @@ -7,9 +7,9 @@ install: all @if not exist $(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\adaptors\ @md $(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\adaptors @if not exist $(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\functors\ @md $(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\functors @if not exist $(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\tuple-utils\ @md $(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\tuple-utils - @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_LIBNAME).dll $(PREFIX)\bin - @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_LIBNAME).pdb $(PREFIX)\bin - @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_LIBNAME).lib $(PREFIX)\lib + @if "$(STATIC)" == "" copy /b $(LIBSIGC_DLL) $(PREFIX)\bin + @if "$(STATIC)" == "" copy /b $(LIBSIGC_DLL:.dll=.pdb) $(PREFIX)\bin + @copy /b $(LIBSIGC_LIB) $(PREFIX)\lib @copy "..\sigc++\sigc++.h" "$(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\" @for %h in ($(LIBSIGC_INT_HDRS)) do @copy "..\sigc++\%h" "$(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\%h" @if exist sigc++config.h copy "sigc++config.h" "$(PREFIX)\lib\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\include\" From a9d8305a29724a2c596a823e46ecc0fe904d62db Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 12:22:27 +0800 Subject: [PATCH 13/60] sigc++.pc.in: Set -DLIBSIGCXX_STATIC in cxxflags as needed Update the Meson build files to put in -DLIBSIGCXX_STATIC when we are building a static build of libsigc++. For the CMake and autotools build, this is not used. --- CMakeLists.txt | 1 + configure.ac | 2 ++ meson.build | 4 +++- sigc++.pc.in | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5741400..c4b291c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ set (SIGCXX_MICRO_VERSION 0) set (SIGCXX_API_VERSION 3.0) set (PACKAGE_VERSION ${SIGCXX_MAJOR_VERSION}.${SIGCXX_MINOR_VERSION}.${SIGCXX_MICRO_VERSION}) set (LIBSIGCPP_SOVERSION 0) +set (MSVC_STATIC_CXXFLAG "") option (SIGCXX_DISABLE_DEPRECATED "Disable deprecated" OFF) diff --git a/configure.ac b/configure.ac index 2256657..52237da 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,8 @@ AS_IF([test "x$enable_benchmark" = xyes],[ AX_BOOST_TIMER ]) +AC_SUBST(MSVC_STATIC_CXXFLAG, '') + AC_CONFIG_FILES([Makefile ${SIGCXX_MODULE_NAME}.pc:sigc++.pc.in ${SIGCXX_MODULE_NAME}-uninstalled.pc:sigc++-uninstalled.pc.in diff --git a/meson.build b/meson.build index 4777ed5..4c975d4 100644 --- a/meson.build +++ b/meson.build @@ -193,6 +193,7 @@ add_project_arguments(warning_flags, language: 'cpp') # MSVC: Ignore warnings that aren't really harmful, but make those # that should not be overlooked stand out. +static_cxxflag = '-DLIBSIGCXX_STATIC' if is_msvc disable_warnings_list = [ '/EHsc', # avoid warnings caused by exception handling model used @@ -217,7 +218,7 @@ if is_msvc language: 'cpp' ) if is_msvc_static - add_project_arguments(['-DLIBSIGCXX_STATIC'], language: 'cpp') + add_project_arguments(static_cxxflag, language: 'cpp') endif endif @@ -239,6 +240,7 @@ endif pkg_conf_data.set('SIGCXX_MAJOR_VERSION', sigcxx_major_version) pkg_conf_data.set('SIGCXX_MINOR_VERSION', sigcxx_minor_version) pkg_conf_data.set('SIGCXX_MICRO_VERSION', sigcxx_micro_version) +pkg_conf_data.set('MSVC_STATIC_CXXFLAG', is_msvc_static ? static_cxxflag : '') configure_file( input: 'sigc++.pc.in', diff --git a/sigc++.pc.in b/sigc++.pc.in index 16a5514..e162f2f 100644 --- a/sigc++.pc.in +++ b/sigc++.pc.in @@ -15,4 +15,4 @@ Description: Typesafe signal and callback system for C++ Version: @PACKAGE_VERSION@ URL: https://libsigcplusplus.github.io/libsigcplusplus/ Libs: -L${libdir} -lsigc-@SIGCXX_API_VERSION@ -Cflags: -I${includedir}/sigc++-@SIGCXX_API_VERSION@ -I${libdir}/sigc++-@SIGCXX_API_VERSION@/include +Cflags: -I${includedir}/sigc++-@SIGCXX_API_VERSION@ -I${libdir}/sigc++-@SIGCXX_API_VERSION@/include @MSVC_STATIC_CXXFLAG@ From 9e7517a0c47c6e659cfd26384bcdb2a4311a6e12 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 12:26:48 +0800 Subject: [PATCH 14/60] MSVC_NMake/README.txt: Mention about static builds --- MSVC_NMake/README.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MSVC_NMake/README.txt b/MSVC_NMake/README.txt index d3ba16f..5438335 100644 --- a/MSVC_NMake/README.txt +++ b/MSVC_NMake/README.txt @@ -45,6 +45,10 @@ PREFIX: Optional. Base directory of where the third-party headers, libraries $(X) is the short version of the Visual Studio used, as follows: 2017: 15 +STATIC: Optional. Set if building libsigc++ as a static library. Note that + for building items that use this static build, /DLIBSIGCXX_STATIC + must be passed into the compiler flags. + USE_COMPAT_LIBS: Build the sigc++ DLL and .lib with the filename 'sigc-vc150(d)-3_0' for all builds. This is for compatibility reasons, if re-building dependent code is not From d83dcfcf507356cc81dcb3e831d26b693b9c5397 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 12:26:48 +0800 Subject: [PATCH 15/60] Visual Studio builds: Convert build docs to MarkDown Convert the README.txt to MarkDown format so that it is easier on the eye in terms of formatting, and update some of the info: * ARM64 is actually supported * Move the part on static builds as appropriate * Some other minor tweaks --- MSVC_NMake/MSVC-Builds.md | 65 +++++++++++++++++++++++++++++++++++++++ MSVC_NMake/README.txt | 63 ------------------------------------- MSVC_NMake/filelist.am | 2 +- README.md | 2 +- 4 files changed, 67 insertions(+), 65 deletions(-) create mode 100644 MSVC_NMake/MSVC-Builds.md delete mode 100644 MSVC_NMake/README.txt diff --git a/MSVC_NMake/MSVC-Builds.md b/MSVC_NMake/MSVC-Builds.md new file mode 100644 index 0000000..4271176 --- /dev/null +++ b/MSVC_NMake/MSVC-Builds.md @@ -0,0 +1,65 @@ +Instructions for building libsigc++ on Visual Studio += + +Building libsigc++ on Windows is now supported using Visual Studio +versions 2017 or later in both 32-bit and 64-bit (x64 and ARM64) flavors, +via NMake Makefiles. Due to `C++17` usage, Visual Studio 2015 or +earlier is not supported, and any use of the headers installed with +this package will require the use of the `/std:c++17` compiler flag. + +libsigc++ itself has no external dependencies, but building the +benchmark test program will require an installation of the Boost +C++ libraries. + +Building with NMake +- +The following describes what items are built with the following +targets: + +* `all`, `examples`: (or no target specified): The libsigc++ DLL and the example programs. +* `tests`: The libsigc++ DLL and the test programs. +* `benchmark`: The libsigc++ DLL and the benchmark program, the Boost C++ headers should be found in one of the paths that are in`%INCLUDE%`. + +Building directly from a GIT checkout is now supported, provided that a `PERL` +installation is present (pass the `PERL` interpreter executable in your NMake +command line by using `nmake /f Makefile.vc ... PERL=` by using +the `prep-git-build` target. + +The following are instructions for performing such a build. A `clean` target is +provided-it is recommended that one cleans the build and redo the build if any +configuration option changed. An `install` target is also provided to copy the built +items in their appropriate +locations under `$(PREFIX)`, which is described below. + +Invoke the build by issuing the command: +`nmake /f Makefile.vc CFG=[release|debug] [PREFIX=...] ` +where: + +* `CFG`: Required. Choose from a `release` or `debug` build. Note that + all builds generate a `.pdb` file for each `.dll` and `.exe` built. + +* `PREFIX`: Optional. Base directory of where the third-party headers, libraries +and needed tools can be found, i.e. headers in `$(PREFIX)\include`, +libraries in `$(PREFIX)\lib` and tools and DLLs in `$(PREFIX)\bin`. If not +specified, `$(PREFIX)` is set as `$(srcroot)\..\vs$(X)\$(platform)`, where +`$(platform)` is `win32` for 32-bit builds or `x64` for 64-bit (Intel/AMD) +builds or `arm64` for 64-bit (ARM) builds, and `$(X)` is the short version of the +Visual Studio used, as follows: + * 2017: `15` + * 2019: `16` + * 2022: `17` + +* `USE_COMPAT_LIBS`: Build the libsigc++ DLL and .lib with the filename +`sigc-vc150(d)-3_0` for all builds. This is for compatibility reasons, +if re-building dependent code is not convenient, for instance + +* Options, set by `