summaryrefslogtreecommitdiff
path: root/MSVC_NMake
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2020-06-16 17:14:00 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2020-06-16 17:14:00 +0800
commit6f509965efe3a6acf37adc076af083143ec6e81e (patch)
tree09bb0e79485bda89e93ab9330edce6ba88969333 /MSVC_NMake
parentf5c77516c441b9491df74a70f4a5f883aca9a22b (diff)
NMake Makefiles: Use toolset version in DLL/.lib filenames
We now use the toolset version ('vc141' for Visual Studio 2017 and 'vc142' for Visual Studio 2019) in the DLL anbd .lib filenames by default, to be consistent with what is now being done in the 'cairo-1-14' branch. If using the old naming convention is desired, a command line option 'USE_COMPAT_LIBS' is added to facilitate such builds
Diffstat (limited to 'MSVC_NMake')
-rw-r--r--MSVC_NMake/README5
-rw-r--r--MSVC_NMake/config-msvc.mak8
-rw-r--r--MSVC_NMake/detectenv-msvc.mak45
3 files changed, 38 insertions, 20 deletions
diff --git a/MSVC_NMake/README b/MSVC_NMake/README
index 6521b27..6a60d62 100644
--- a/MSVC_NMake/README
+++ b/MSVC_NMake/README
@@ -5,7 +5,10 @@ Building cairomm-1.16 with Visual Studio .NET 2017 or later
the paths to headers and import libraries to Visual Studio, if they are not already in $(srcroot)/../vs15/$(Platform).
* In a Visual Studio command prompt, go to $(srcroot)\MSVC_NMake
* Build using nmake /f Makefile.vc CFG=[release|debug]
-* Run the tests (not currently buildable).
+* Run the tests.
+* Now the built DLL and .lib files use the toolset version ('vc141' for Visual Studio 2017 and 'vc142' for Visual Studio
+ 2019) instead of the Visual Studio version ('vc150' for Visual Studio 2017) by default. If using the old naming style,
+ please note that libsigc++-3.x must be built with this option enabled as well, if building it with NMake.
Cedric Gustin
08/18/2006
diff --git a/MSVC_NMake/config-msvc.mak b/MSVC_NMake/config-msvc.mak
index 0f217da..4735b47 100644
--- a/MSVC_NMake/config-msvc.mak
+++ b/MSVC_NMake/config-msvc.mak
@@ -45,20 +45,20 @@ CAIROMM_TEST_CFLAGS = \
CAIROMM_INT_SOURCES = $(cairomm_cc:/=\)
CAIROMM_INT_HDRS = $(cairomm_public_h:/=\)
-# We build cairomm-vc$(VSVER)0-$(CAIROMM_MAJOR_VERSION)_$(CAIROMM_MINOR_VERSION).dll or
-# cairomm-vc$(VSVER)0-d-$(CAIROMM_MAJOR_VERSION)_$(CAIROMM_MINOR_VERSION).dll at least
+# We build cairomm-vc$(VSVER_LIB)-$(CAIROMM_MAJOR_VERSION)_$(CAIROMM_MINOR_VERSION).dll or
+# cairomm-vc$(VSVER_LIB)-d-$(CAIROMM_MAJOR_VERSION)_$(CAIROMM_MINOR_VERSION).dll at least
!ifdef USE_MESON_LIBS
LIBSIGC_LIBNAME = sigc-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)
LIBSIGC_DLL = $(LIBSIGC_LIBNAME)-0.dll
!else
-LIBSIGC_LIBNAME = sigc-vc$(VSVER)0$(DEBUG_SUFFIX)-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION)
+LIBSIGC_LIBNAME = sigc-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION)
LIBSIGC_DLL = $(LIBSIGC_LIBNAME).dll
!endif
LIBSIGC_LIB = $(LIBSIGC_LIBNAME).lib
-CAIROMM_LIBNAME = cairomm-vc$(VSVER)0$(DEBUG_SUFFIX)-$(CAIROMM_MAJOR_VERSION)_$(CAIROMM_MINOR_VERSION)
+CAIROMM_LIBNAME = cairomm-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(CAIROMM_MAJOR_VERSION)_$(CAIROMM_MINOR_VERSION)
CAIROMM_DLL = vs$(VSVER)\$(CFG)\$(PLAT)\$(CAIROMM_LIBNAME).dll
CAIROMM_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\$(CAIROMM_LIBNAME).lib
diff --git a/MSVC_NMake/detectenv-msvc.mak b/MSVC_NMake/detectenv-msvc.mak
index 9a92c11..c687835 100644
--- a/MSVC_NMake/detectenv-msvc.mak
+++ b/MSVC_NMake/detectenv-msvc.mak
@@ -79,34 +79,49 @@ _HASH=^#
!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc]
!endif
+VSVER = 0
+PDBVER = 0
+VSVER_SUFFIX = 0
+
!if $(VCVERSION) > 1499 && $(VCVERSION) < 1600
-VSVER = 9
+PDBVER = 9
!elseif $(VCVERSION) > 1599 && $(VCVERSION) < 1700
-VSVER = 10
+PDBVER = 10
!elseif $(VCVERSION) > 1699 && $(VCVERSION) < 1800
-VSVER = 11
+PDBVER = 11
!elseif $(VCVERSION) > 1799 && $(VCVERSION) < 1900
-VSVER = 12
-!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 1910
-VSVER = 14
-!elseif $(VCVERSION) > 1909 && $(VCVERSION) < 2000
+PDBVER = 12
+!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 2000
+PDBVER = 14
+!if $(VCVERSION) > 1909 && $(VCVERSION) < 1920
+VSVER_SUFFIX = 1
VSVER = 15
+!elseif $(VCVERSION) > 1919 && $(VCVERSION) < 2000
+VSVER_SUFFIX = 2
+VSVER = 16
!else
-VSVER = 0
+VSVER = $(PDBVER)
+!endif
+!else
+VSVER = $(PDBVER)
+!endif
+
+!if $(VSVER) > 14 && "$(USE_COMPAT_LIBS)" != ""
+!if $(VSVER) > 15
+VSVER_LIB = 150
+!else
+VSVER_LIB = $(PDBVER)0
+!endif
+!else
+VSVER_LIB = $(PDBVER)$(VSVER_SUFFIX)
!endif
!if "$(VSVER)" == "0"
MSG = ^
This NMake Makefile set supports Visual Studio^
-9 (2008) through 15 (2017). Your Visual Studio^
+9 (2008) through 16 (2019). Your Visual Studio^
version is not supported.
!error $(MSG)
-!else
-!if $(VSVER) < 15
-PDBVER = $(VSVER)
-!else
-PDBVER = 14
-!endif
!endif
VALID_CFGSET = FALSE