Skip to content

Commit

Permalink
Compile debug windows binaries without optimizing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Feb 17, 2015
1 parent bd83a0f commit 5414f79
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
16 changes: 10 additions & 6 deletions src/win32/Makefile.inc
Expand Up @@ -2,14 +2,14 @@
# If no version is forced from the outside set a default.
#
ifeq ($(WIN_VERSION),)
WIN_VERSION=32
WIN_VERSION = 32
endif

#
# If no debug if forced from the ouside set a default.
#
ifeq ($(WIN_DEBUG),)
WIN_DEBUG=no
WIN_DEBUG = no
endif

MINGW_32_BASE = /usr/i686-w64-mingw32
Expand All @@ -19,20 +19,24 @@ ifeq ($(WIN_VERSION),32)
QMAKE = /usr/bin/i686-w64-mingw32-qmake
WINDRES = /usr/bin/i686-w64-mingw32-windres
CXX = /usr/bin/i686-w64-mingw32-g++
ifeq ($(WIN_DEBUG),yes)
CXXFLAGS = $(DEFINES) $(INCLUDES) -Wall -m$(WIN_VERSION) -mwin32 -mthreads -fno-strict-aliasing -Wno-unknown-pragmas -g
else
CXXFLAGS = $(DEFINES) $(INCLUDES) -Wall -m$(WIN_VERSION) -mwin32 -mthreads -O3 -fno-strict-aliasing -Wno-unknown-pragmas
endif
MINGW_LIB = $(MINGW_32_BASE)/sys-root/mingw/lib
else
QMAKE = /usr/bin/x86_64-w64-mingw32-qmake
WINDRES = /usr/bin/x86_64-w64-mingw32-windres
CXX = /usr/bin/x86_64-w64-mingw32-g++
ifeq ($(WIN_DEBUG),yes)
CXXFLAGS = $(DEFINES) $(INCLUDES) -Wall -m$(WIN_VERSION) -mwin32 -mthreads -fno-strict-aliasing -Wno-unknown-pragmas -g
else
CXXFLAGS = $(DEFINES) $(INCLUDES) -Wall -m$(WIN_VERSION) -mwin32 -mthreads -O3 -fno-strict-aliasing -Wno-unknown-pragmas
endif
MINGW_LIB = $(MINGW_64_BASE)/sys-root/mingw/lib
endif
WINSOCKLIB = -lws2_32
LDFLAGS_DLL = -mdll -mwindows
LDFLAGS_WINAPP = -mwindows
LDFLAGS_CONS = -mconsole

ifeq ($(WIN_DEBUG),yes)
CXXFLAGS += -g
endif
8 changes: 7 additions & 1 deletion src/win32/plugins/filed/Makefile
Expand Up @@ -34,6 +34,12 @@ LDLIBS = ../../lib/libbareos.dll \
$(MINGW_LIB)/libz.dll.a \
$(WINSOCKLIB) -lole32 -loleaut32 -luuid

ifeq ($(WIN_DEBUG),yes)
OPT_CXXFLAGS = $(CXXFLAGS) -O2
else
OPT_CXXFLAGS = $(CXXFLAGS)
endif

all: bpipe-fd.dll mssqlvdi-fd.dll

bpipe-fd.dll: DLL_USAGE = -DBUILDING_DLL
Expand All @@ -43,7 +49,7 @@ bpipe-fd.dll: bpipe-fd.o
mssqlvdi-fd.o: CXXFLAGS += -fpermissive
mssqlvdi-fd.o: mssqlvdi-fd.c
@echo "Compiling $<"
$(CXX) $(DLL_USAGE) $(CXXFLAGS) $(VDI_INCLUDES) -c -o $@ $<
$(CXX) $(DLL_USAGE) $(OPT_CXXFLAGS) $(VDI_INCLUDES) -c -o $@ $<

mssqlvdi-fd.dll: DLL_USAGE = -DBUILDING_DLL
mssqlvdi-fd.dll: mssqlvdi-fd.o
Expand Down

0 comments on commit 5414f79

Please sign in to comment.