Skip to content

Commit

Permalink
Win32: Further improvements for building
Browse files Browse the repository at this point in the history
Added config_user.pri for customization and Windows SDK paths,
added envconfig.bat for configuring the command line environment,
and fixed an issue with the wchar version of DOOMSDAY_VERSION_TEXT.
  • Loading branch information
skyjake committed Sep 17, 2011
1 parent e62ad03 commit eeaf1e6
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 22 deletions.
8 changes: 2 additions & 6 deletions distrib/win32/dorel.bat
@@ -1,12 +1,8 @@
@echo off
REM -- Does a complete Win32 Binary Release distribution.

REM -- Visual C++ environment.
call "c:\Program Files\Microsoft Visual Studio 9.0\vc\vcvarsall.bat"

REM -- Qt environment.
SET JOM="c:\QtSDK\QtCreator\bin\jom.exe"
call "c:\QtSDK\Desktop\Qt\4.7.4\msvc2008\bin\qtenv2.bat"
REM -- Set up the build environment.
call ..\..\doomsday\build\win32\envconfig.bat

REM -- Build number.
SET DOOMSDAY_BUILD=%1
Expand Down
19 changes: 19 additions & 0 deletions doomsday/build/win32/envconfig-example.bat
@@ -0,0 +1,19 @@
@echo off
:: Sets up the command line environment for building.
:: This is automatically called by dorel.bat.

:: Directory Config -------------------------------------------------------

:: Modify these paths for your system.
set MSVC9_DIR=c:\Program Files\Microsoft Visual Studio 9.0
set QTCREATOR_DIR=c:\QtSDK\QtCreator
set QT_BIN_DIR=c:\QtSDK\Desktop\Qt\4.7.4\msvc2008\bin

:: Build Tools Setup ------------------------------------------------------

:: Visual C++ environment.
call "%MSVC9_DIR%\vc\vcvarsall.bat"

:: -- Qt environment.
set JOM=%QTCREATOR_DIR%\bin\jom.exe
call "%QT_BIN_DIR%\qtenv2.bat"
8 changes: 5 additions & 3 deletions doomsday/config.pri
Expand Up @@ -55,9 +55,6 @@ win32 {

DEFINES += WIN32 _CRT_SECURE_NO_WARNINGS

# Not all of our dependencies support a UNICODE build.
#DEFINES -= UNICODE

DENG_EXPORT_LIB = $$OUT_PWD/../engine/doomsday.lib

# Also build the OpenAL plugin.
Expand Down Expand Up @@ -132,6 +129,11 @@ macx {
}
}

# Options defined by the user (may not exist).
exists(config_user.pri) {
include(config_user.pri)
}

# Apply Configuration --------------------------------------------------------

deng_nofixedasm {
Expand Down
24 changes: 24 additions & 0 deletions doomsday/config_user.pri
@@ -0,0 +1,24 @@
# Custom configuration options.
# On all platforms you can apply custom build options here.
# On Windows, you need to use this file to configure your SDK paths.

# Location of the cURL SDK.
CURL_DIR = "c:/SDK/cURL"

# Location of the EAX 2.0 SDK.
EAX2_DIR = "c:/SDK/EAX 2.0 SDK"

# Location of the DirectX SDK.
DIRECTX_DIR = "c:/SDK/DirectX \(March 2009\)"

# Location of the OpenAL SDK.
OPENAL_DIR = "c:/SDK/OpenAL 1.1 SDK"

# Location of the GL headers.
OPENGL_DIR = c:/SDK/OpenGL

# Location of the SDL SDK.
SDL_DIR = c:/SDK/SDL-1.2.14

# Location of the SDL_mixer SDK.
SDL_MIXER_DIR = c:/SDK/SDL_mixer-1.2.11
4 changes: 3 additions & 1 deletion doomsday/dep_curl.pri
@@ -1,6 +1,8 @@
# Build configuration for cURL.
win32 {
CURL_DIR = "C:/SDK/curl"
isEmpty(CURL_DIR) {
error("dep_curl: cURL SDK path not defined, check your config_user.pri")
}

INCLUDEPATH += $$CURL_DIR/include
LIBS += -l$$CURL_DIR/libcurl_imp
Expand Down
1 change: 1 addition & 0 deletions doomsday/dep_curses.pri
Expand Up @@ -3,6 +3,7 @@ macx {
LIBS += -lcurses
}
else:win32 {
# Curses is not used on Windows.
}
else {
# Generic Unix.
Expand Down
8 changes: 6 additions & 2 deletions doomsday/dep_directx.pri
@@ -1,5 +1,9 @@
# Build configuration for DirectX.
win32 {
INCLUDEPATH += "C:/SDK/DirectX \(March 2009\)/Include"
LIBS += -L"C:/SDK/DirectX \(March 2009\)/Lib/x86" -ldinput8 -ldsound -ldxguid
isEmpty(DIRECTX_DIR) {
error("dep_directx: DirectX SDK path not defined, check your config_user.pri")
}

INCLUDEPATH += $$DIRECTX_DIR/Include
LIBS += -L$$DIRECTX_DIR/Lib/x86 -ldinput8 -ldsound -ldxguid
}
10 changes: 7 additions & 3 deletions doomsday/dep_eax.pri
@@ -1,10 +1,14 @@
# Build configuration for EAX.
win32 {
INCLUDEPATH += "C:/SDK/EAX 2.0 SDK/Include"
LIBS += -L"C:/SDK/EAX 2.0 SDK/Libs" -leax -leaxguid
isEmpty(EAX2_DIR) {
error("dep_eax: EAX 2.0 SDK path not defined, check your config_user.pri")
}

INCLUDEPATH += $$EAX2_DIR/Include
LIBS += -L$$EAX2_DIR/Libs -leax -leaxguid

# Libraries for the built products.
INSTALLS += eaxlibs
eaxlibs.files = "C:/SDK/EAX 2.0 SDK/dll/eax.dll"
eaxlibs.files = $$EAX2_DIR/dll/eax.dll
eaxlibs.path = $$DENG_WIN_PRODUCTS_DIR
}
8 changes: 6 additions & 2 deletions doomsday/dep_openal.pri
@@ -1,8 +1,12 @@
# Build configuration for OpenAL.
win32 {
isEmpty(OPENAL_DIR) {
error("dep_openal: OpenAL SDK path not defined, check your config_user.pri")
}

# Windows.
INCLUDEPATH += "C:/SDK/OpenAL 1.1 SDK/include"
LIBS += -L"C:/SDK/OpenAL 1.1 SDK/libs/win32" -lopenal32
INCLUDEPATH += $$OPENAL_DIR/include
LIBS += -L$$OPENAL_DIR/libs/win32 -lopenal32
}
else:macx {
# Mac OS X.
Expand Down
6 changes: 5 additions & 1 deletion doomsday/dep_opengl.pri
@@ -1,7 +1,11 @@
# Build configuration for OpenGL.
win32 {
isEmpty(OPENGL_DIR) {
error("dep_opengl: OpenGL SDK path not defined, check your config_user.pri")
}

# Windows.
INCLUDEPATH += C:/SDK/OpenGL
INCLUDEPATH += $$OPENGL_DIR
}
else:macx {
# Mac OS X.
Expand Down
8 changes: 6 additions & 2 deletions doomsday/dep_sdl.pri
@@ -1,7 +1,11 @@
# Build configuration for SDL.
win32 {
SDL_DIR = C:/SDK/SDL-1.2.14
SDL_MIXER_DIR = C:/SDK/SDL_mixer-1.2.11
isEmpty(SDL_DIR) {
error("dep_sdl: SDL path not defined, check your config_user.pri")
}
isEmpty(SDL_MIXER_DIR) {
error("dep_sdl: SDL_mixer path not defined, check your config_user.pri")
}

# Windows.
INCLUDEPATH += \
Expand Down
7 changes: 7 additions & 0 deletions doomsday/engine/engine.pro
Expand Up @@ -29,6 +29,13 @@ win32 {

DEFINES += __DOOMSDAY__

!isEmpty(DENG_BUILD) {
echo(DENG_BUILD $$DENG_BUILD)
DEFINES += DOOMSDAY_BUILD_TEXT=\\\"$$DENG_BUILD\\\"
} else {
echo(DENG_BUILD is not defined.)
}

unix:!macx {
DEFINES += DENG_BASE_DIR=\\\"$${DENG_BASE_DIR}/\\\"
DEFINES += DENG_LIBRARY_DIR=\\\"$${DENG_LIB_DIR}/\\\"
Expand Down
5 changes: 4 additions & 1 deletion doomsday/engine/portable/include/dd_version.h
Expand Up @@ -72,9 +72,12 @@

#if defined(DOOMSDAY_BUILD_TEXT)
/** The build number is included only for non-Stable builds. */
# if defined(WIN32) && defined(UNICODE)
# define DOOMSDAY_VERSION_TEXT_WSTR TEXT(DOOMSDAY_VERSION_BASE) TEXT(" (#") TEXT(DOOMSDAY_BUILD_TEXT) TEXT(")")
# endif
# define DOOMSDAY_VERSION_TEXT DOOMSDAY_VERSION_BASE " (#" DOOMSDAY_BUILD_TEXT ")"
#elif defined(DOOMSDAY_RELEASE_NAME)
# define DOOMSDAY_VERSION_TEXT DOOMSDAY_VERSION_BASE "-" DOOMSDAY_RELEASE_NAME
# define DOOMSDAY_VERSION_TEXT (DOOMSDAY_VERSION_BASE "-" DOOMSDAY_RELEASE_NAME)
#else
# define DOOMSDAY_VERSION_TEXT DOOMSDAY_VERSION_BASE
#endif
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/dd_pinit.c
Expand Up @@ -95,7 +95,7 @@ void DD_ErrorBox(boolean error, char* format, ...)
#ifdef WIN32
suspendMsgPump = true;
MessageBox(NULL, WIN_STRING(buff),
TEXT("Doomsday ") TEXT(DOOMSDAY_VERSION_TEXT),
TEXT("Doomsday ") DOOMSDAY_VERSION_TEXT_WSTR,
(UINT) (MB_OK | (error ? MB_ICONERROR : MB_ICONWARNING)));
suspendMsgPump = false;
#endif
Expand Down

0 comments on commit eeaf1e6

Please sign in to comment.