Skip to content

Commit

Permalink
modified for MSVC.
Browse files Browse the repository at this point in the history
  • Loading branch information
treefrogframework committed Sep 27, 2014
1 parent 426f675 commit f1dd7fd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/mongo-c-driver/mongo-c-driver.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TEMPLATE = lib
TARGET = mongoc
CONFIG += static console
CONFIG -= qt
DEFINES += MONGO_HAVE_STDINT MONGO_DLL_BUILD _POSIX_SOURCE
DEFINES += MONGO_HAVE_STDINT MONGO_DLL_BUILD _POSIX_SOURCE MONGO_STATIC_BUILD
macx:DEFINES += _DARWIN_C_SOURCE
*-g++|*-clang {
QMAKE_CFLAGS += -std=c99
Expand Down
18 changes: 13 additions & 5 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
:: Edit this line to run the batch file for Qt environment.
::
::call "C:\Qt\Qt5.2.1\5.2.1\mingw48_32\bin\qtenv2.bat"
call "C:\Qt\Qt5.3.1\5.3\mingw482_32\bin\qtenv2.bat"
::call "C:\Qt\Qt5.3.1\5.3\mingw482_32\bin\qtenv2.bat"
call "C:\Qt\Qt5.3.2\5.3\msvc2013_64\bin\qtenv2.bat"


if "%DevEnvDir%" == "" (
set MAKE=mingw32-make -j4
) else (
set MAKE=nmake
)

::
:: Compile and Install
Expand All @@ -16,23 +24,23 @@ call configure.bat --enable-debug
if ERRORLEVEL 1 goto :error

cd src
mingw32-make.exe -j4 install
%MAKE% install
if ERRORLEVEL 1 goto :error

cd ..\tools
mingw32-make.exe -j4 install
%MAKE% install
if ERRORLEVEL 1 goto :error

cd ..
call configure.bat
if ERRORLEVEL 1 goto :error

cd src
mingw32-make.exe -j4 install
%MAKE% install
if ERRORLEVEL 1 goto :error

cd ..\tools
mingw32-make.exe -j4 install
%MAKE% install
if ERRORLEVEL 1 goto :error

echo.
Expand Down
24 changes: 15 additions & 9 deletions configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
set VERSION=1.7.7
set TFDIR=C:\TreeFrog\%VERSION%

if "%DevEnvDir%" == "" (
set MAKE=mingw32-make
) else (
set MAKE=nmake
)

:parse_loop
if "%1" == "" goto :start
if /i "%1" == "--prefix" goto :prefix
Expand Down Expand Up @@ -72,8 +78,8 @@ set TFDIR=%TFDIR:\=/%
echo Compiling MongoDB driver library ...
cd 3rdparty\mongo-c-driver
qmake -r %OPT%
mingw32-make clean >nul 2>&1
mingw32-make >nul 2>&1
%MAKE% clean >nul 2>&1
%MAKE% >nul 2>&1
if ERRORLEVEL 1 (
echo Compile failed.
echo MongoDB driver not available.
Expand All @@ -82,18 +88,18 @@ if ERRORLEVEL 1 (
cd ..\..

cd src
if exist Makefile ( mingw32-make -k distclean >nul 2>&1 )
qmake -spec win32-g++ %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' %USE_GUI%
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' %USE_GUI%
cd ..
cd tools
if exist Makefile ( mingw32-make -k distclean >nul 2>&1 )
qmake -recursive -spec win32-g++ %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' datadir='%TFDIR%'
mingw32-make qmake
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake -recursive %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' datadir='%TFDIR%'
%MAKE% qmake
cd ..

echo;
echo First, run "mingw32-make install" in src directory.
echo Next, run "mingw32-make install" in tools directory.
echo First, run "%MAKE% install" in src directory.
echo Next, run "%MAKE% install" in tools directory.

:exit
exit /b

0 comments on commit f1dd7fd

Please sign in to comment.