diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2014-01-20 16:30:22 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2014-01-20 16:30:22 +0800 |
commit | 39703440cfd4e7949708266270e447b7b22c9347 (patch) | |
tree | cfa236428be0cf0467ea9684fb19555339043c88 /build/detectenv_msvc.mak | |
parent | 9c2a45a635d9cd6ac752245be4af6d3f00212349 (diff) | |
download | gobject-introspection-39703440cfd4e7949708266270e447b7b22c9347.tar.gz |
Rework The Visual Studio 2008 Build Process
This patch makes the build of G-I on Visual Studio 2008 into a two-step
process, as it would make it clearer and easier to the one building G-I by:
-Splitting up the property sheets into multiple parts, where pre-configured
code (which is currently shipped with the tarball) is copied using custom
build steps, so that they can be re-copied when they are updated. This
also removes the need for setting environment variables before launching
the Visual Studio Project to build the G-I DLL, the tools written in C and
the _giscanner Python2 module. The Python2 paths (set to Python 2.7.x)
are now set in a property sheet, which can be updated quite easily, if
needed.
-Use a set of NMake Makefiles to build the introspection files for GLib,
and also the .gir's that are shipped with G-I, and make it clear to people
what things are needed to build the introspection files.
-Standardizing across the board that we now use $(ApiVersion) for the .lib
files and the "installation" of headers, etc.
Similar updates to the Visual Studio 2010 files will follow later.
Diffstat (limited to 'build/detectenv_msvc.mak')
-rw-r--r-- | build/detectenv_msvc.mak | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/build/detectenv_msvc.mak b/build/detectenv_msvc.mak new file mode 100644 index 00000000..3e3dcdf4 --- /dev/null +++ b/build/detectenv_msvc.mak @@ -0,0 +1,65 @@ +# Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or
+# VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir)
+!if !defined(VCINSTALLDIR) && !defined(WINDOWSSDKDIR)
+MSG = ^
+This Makefile is only for Visual Studio 2008 and later.^
+You need to ensure that the Visual Studio Environment is properly set up^
+before running this Makefile.
+!error $(MSG)
+!endif
+
+ERRNUL = 2>NUL
+_HASH=^#
+
+!if ![echo VCVERSION=_MSC_VER > vercl.x] \
+ && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \
+ && ![echo PLAT=Win32 >> vercl.x] \
+ && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \
+ && ![echo PLAT=x64 >> vercl.x] \
+ && ![echo $(_HASH)endif >> vercl.x] \
+ && ![cl -nologo -TC -P vercl.x $(ERRNUL)]
+!include vercl.i
+!if ![echo VCVER= ^\> vercl.vc] \
+ && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc]
+!include vercl.vc
+!endif
+!endif
+!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc]
+!endif
+
+!if $(VCVERSION) > 1499 && $(VCVERSION) < 1600
+VSVER = 9
+!elseif $(VCVERSION) > 1599 && $(VCVERSION) < 1700
+VSVER = 10
+!elseif $(VCVERSION) > 1699 && $(VCVERSION) < 1800
+VSVER = 11
+!elseif $(VCVERSION) > 1799 && $(VCVERSION) < 1900
+VSVER = 12
+!else
+VSVER = 0
+!endif
+
+!if "$(VSVER)" == "0"
+MSG = ^
+This NMake Makefile set supports Visual Studio^
+9 (2008) through 12 (2013). Your Visual Studio^
+version is not supported.
+!error $(MSG)
+!endif
+
+VALID_CFGSET = FALSE
+!if "$(CFG)" == "release" || "$(CFG)" == "debug"
+VALID_CFGSET = TRUE
+!endif
+
+!if "$(CFG)" == "release"
+CFLAGS_ADD = /MD /O2
+!else
+CFLAGS_ADD = /MDd /Od /Zi /DG_ENABLE_DEBUG
+!endif
+
+!if "$(PLAT)" == "x64"
+LDFLAGS_ARCH = /machine:x64
+!else
+LDFLAGS_ARCH = /machine:x86
+!endif
\ No newline at end of file |