aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2013-09-04 11:13:03 +1000
committerNeil <nyamatongwe@gmail.com>2013-09-04 11:13:03 +1000
commitab73f3d64f0c6caae8d7eeb35ae37aa23b5cf3c1 (patch)
treeda8f62680c3a2234dac0ed601e3ec452ba578569
parent4f18dd4cea751c6867d1f00f1eadb703e604c551 (diff)
downloadscintilla-mirror-ab73f3d64f0c6caae8d7eeb35ae37aa23b5cf3c1.tar.gz
Build Direct2D platform code if Direct2D headers are available.
-rw-r--r--win32/makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/win32/makefile b/win32/makefile
index 2ca18d160..23f253255 100644
--- a/win32/makefile
+++ b/win32/makefile
@@ -1,7 +1,7 @@
# Make file for Scintilla on Windows
# Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
# The License.txt file describes the conditions under which this software may be distributed.
-# This makefile assumes the mingw32 version of GCC 3.x or 4.x is used and changes will
+# This makefile assumes the MinGW32 version of GCC 4.x is used and changes will
# be needed to use other compilers.
.SUFFIXES: .cxx
@@ -19,7 +19,14 @@ LDFLAGS=-shared -static -Wl,--enable-runtime-pseudo-reloc-v2 -mwindows -Wl,--add
LIBS=-lstdc++ -limm32 -lole32 -luuid
# Add -MMD to get dependencies
INCLUDEDIRS=-I ../include -I ../src -I../lexlib
-CXXBASEFLAGS=--std=c++0x -Wall -Wno-missing-braces -Wno-char-subscripts -pedantic $(INCLUDEDIRS) -fno-rtti -DDISABLE_D2D
+
+# Check if Direct2D headers are available by trying to compile a file that includes them.
+# Most distributions of MinGW32 do not include Direct2D support but MinGW64 does.
+ifneq "$(shell g++ -c CheckD2D.cxx 2>&1)" ""
+D2DFLAGS=-DDISABLE_D2D
+endif
+
+CXXBASEFLAGS=--std=c++0x -Wall -Wno-missing-braces -Wno-char-subscripts -pedantic $(INCLUDEDIRS) -fno-rtti $(D2DFLAGS)
ifdef DEBUG
CXXFLAGS=-DDEBUG -g $(CXXBASEFLAGS)