Skip to content

Commit ae7ef5e

Browse files
fanc999-1kjellahl
authored andcommitted
NMake Makefiles: Use toolset version in DLL filename by default
The libsigc++ DLL and .lib was only named 'sigc-vc150(d)-3_0' until the previous patches in this series improved Visual Studio 2019 support to name the DLL and .lib by using 'sigc-vc160(d)-3_0'. This updates the naming of the DLL and .lib to the toolset version as defined by Microsoft by default, i.e. 'vc141' for Visual Studio 2017 and 'vc142' for Visual Studio 2019. If the former DLL naming ('vc150') is desired, passing 'USE_COMPAT_LIBS=1' will achive this.
1 parent d2deab4 commit ae7ef5e

File tree

3 files changed

+36
-18
lines changed

3 files changed

+36
-18
lines changed

MSVC_NMake/README.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ PREFIX: Optional. Base directory of where the third-party headers, libraries
4646
$(X) is the short version of the Visual Studio used, as follows:
4747
2017: 15
4848

49+
USE_COMPAT_LIBS: Build the sigc++ DLL and .lib with the filename
50+
'sigc-vc150(d)-3_0' for all builds. This is for
51+
compatibility reasons, if re-building dependent code is not
52+
convenient, for instance
53+
4954
Explanation of options, set by <option>=1:
5055
------------------------------------------
5156
BOOST_DLL: When building the benchmark, link to a DLL build of the Boost

MSVC_NMake/config-msvc.mak

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ LIBSIGC_INT_HDRS = $(sigc_public_h:/=\)
2424
SIGCPP_CFLAGS = $(SIGCPP_BASE_CFLAGS) $(CFLAGS)
2525
LIBSIGCPP_CFLAGS = $(SIGCPP_CFLAGS) $(LIBSIGCPP_DEFINES)
2626

27-
# We build sigc-vc$(VSVER)0-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION).dll or
28-
# sigc-vc$(VSVER)0d-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION).dll at least
27+
# We build sigc-vc$(VSVER_LIB)-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION).dll or
28+
# sigc-vc$(VSVER_LIB)d-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION).dll at least
2929

30-
LIBSIGC_LIBNAME = sigc-vc$(VSVER)0$(LIBSIGC_DEBUG_SUFFIX)-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION)
30+
LIBSIGC_LIBNAME = sigc-vc$(VSVER_LIB)$(LIBSIGC_DEBUG_SUFFIX)-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION)
3131

3232
LIBSIGC_DLL = vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_LIBNAME).dll
3333
LIBSIGC_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_LIBNAME).lib

MSVC_NMake/detectenv-msvc.mak

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,36 +79,49 @@ _HASH=^#
7979
!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc]
8080
!endif
8181

82+
VSVER = 0
83+
PDBVER = 0
84+
VSVER_SUFFIX = 0
85+
8286
!if $(VCVERSION) > 1499 && $(VCVERSION) < 1600
83-
VSVER = 9
87+
PDBVER = 9
8488
!elseif $(VCVERSION) > 1599 && $(VCVERSION) < 1700
85-
VSVER = 10
89+
PDBVER = 10
8690
!elseif $(VCVERSION) > 1699 && $(VCVERSION) < 1800
87-
VSVER = 11
91+
PDBVER = 11
8892
!elseif $(VCVERSION) > 1799 && $(VCVERSION) < 1900
89-
VSVER = 12
90-
!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 1910
91-
VSVER = 14
92-
!elseif $(VCVERSION) > 1909 && $(VCVERSION) < 1920
93+
PDBVER = 12
94+
!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 2000
95+
PDBVER = 14
96+
!if $(VCVERSION) > 1909 && $(VCVERSION) < 1920
97+
VSVER_SUFFIX = 1
9398
VSVER = 15
9499
!elseif $(VCVERSION) > 1919 && $(VCVERSION) < 2000
100+
VSVER_SUFFIX = 2
95101
VSVER = 16
96102
!else
97-
VSVER = 0
103+
VSVER = $(PDBVER)
104+
!endif
105+
!else
106+
VSVER = $(PDBVER)
107+
!endif
108+
109+
!if "$(USE_COMPAT_LIBS)" != ""
110+
!if $(VSVER) > 15
111+
VSVER_LIB = 150
112+
!else
113+
VSVER_LIB = $(VSVER)0
114+
!endif
115+
!else
116+
VSVER_LIB = $(PDBVER)$(VSVER_SUFFIX)
98117
!endif
99118

100119
!if "$(VSVER)" == "0"
101120
MSG = ^
102121
This NMake Makefile set supports Visual Studio^
103-
9 (2008) through 15 (2017). Your Visual Studio^
122+
9 (2008) through 16 (2019). Your Visual Studio^
104123
version is not supported.
105124
!error $(MSG)
106-
!else
107-
!if $(VSVER) < 15
108-
PDBVER = $(VSVER)
109-
!else
110-
PDBVER = 14
111-
!endif
112125
!endif
113126

114127
VALID_CFGSET = FALSE

0 commit comments

Comments
 (0)