Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build script #649

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions BuildLinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ make install
cd ../../Standalone/Build
cmake -G "Unix Makefiles" ..
make install
cd ../../IDE/Build/Linux
make
173 changes: 173 additions & 0 deletions BuildWindows.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
@rem Configuration -------------------------------------------------------------

@rem Platform - either "Win32" or "x64"
if "%1%"=="" (
@set platform=Win32

@rem Visual Studio version to pass to cmake
@set generator=Visual Studio 12
) else (
@set platform=%1%
if "%1%"=="Win32" (
@rem Visual Studio version to pass to cmake
@set generator=Visual Studio 12
) else (
@rem Visual Studio version to pass to cmake
@set generator=Visual Studio 12 Win64
)
)

@rem Visual C++ compiler path, where 'vcvarsall.bat' is located
@set vcPath=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC

@rem Optional cmake path. Set manually only if not set in PATH system variable
@set cmakePath=

@rem Optional Python path. Set manually only if not set in PATH system variable
@set pythonPath=C:\Python27

@rem Begin build ---------------------------------------------------------------

@set baseDir=%cd%

@call "%vcPath%\vcvarsall.bat" x86
@if %errorlevel% neq 0 goto error
@for %%x in (MSBuild.exe) do @(set msbuildFound=%%~$PATH:x)
@if not defined msbuildFound echo MSBuild.exe not found. Edit 'vcPath' variable to correct path. & goto error

@if defined cmakePath set PATH=%PATH%;%cmakePath%
@for %%x in (cmake.exe) do @(set cmakeFound=%%~$PATH:x)
@if not defined cmakeFound echo cmake.exe not found. Edit 'cmakePath' variable to correct path. & goto error

@if defined pythonPath set PATH=%PATH%;%pythonPath%
@for %%x in (python.exe) do @(set pythonFound=%%~$PATH:x)
@if not defined pythonFound echo python.exe not found. Edit 'pythonPath' variable to correct path. & goto error

@echo Building with "%generator%" for "%platform%"...

@rem cleaning up --------------------------------------------------------------
@cd "%baseDir%"
:while0
@if exist Release rmdir /s /q Release
@if exist Release goto while0

@rem Build Dependencies --------------------------------------------------------

@cd "%baseDir%"
@if %errorlevel% neq 0 goto error
@cd Dependencies
@if %errorlevel% neq 0 goto error

:while1
@if exist Build rmdir /s /q Build
@if exist Build goto while1

@mkdir Build
@if %errorlevel% neq 0 goto error
@cd Build
@if %errorlevel% neq 0 goto error

@cmake -G "%generator%" ..
@if %errorlevel% neq 0 goto error

@MSBuild.exe /nologo /property:Configuration=Debug ALL_BUILD.vcxproj
@if %errorlevel% neq 0 goto error
@MSBuild.exe /nologo /property:Configuration=Debug glext.vcxproj
@if %errorlevel% neq 0 goto error
@MSBuild.exe /nologo /property:Configuration=Debug wglext.vcxproj
@if %errorlevel% neq 0 goto error

@MSBuild.exe /nologo /property:Configuration=Release ALL_BUILD.vcxproj
@if %errorlevel% neq 0 goto error
@MSBuild.exe /nologo /property:Configuration=Release glext.vcxproj
@if %errorlevel% neq 0 goto error
@MSBuild.exe /nologo /property:Configuration=Release wglext.vcxproj
@if %errorlevel% neq 0 goto error

@rem Build Polycode ------------------------------------------------------------

@cd "%baseDir%"
@if %errorlevel% neq 0 goto error

:while2
@if exist Build rmdir /s /q Build
@if exist Build goto while2

@mkdir Build
@if %errorlevel% neq 0 goto error
@cd Build
@if %errorlevel% neq 0 goto error

@cmake -G "%generator%" .. -DPOLYCODE_BUILD_BINDINGS=ON -DPOLYCODE_BUILD_PLAYER=ON
@if %errorlevel% neq 0 goto error

@MSBuild.exe /nologo /property:Configuration=Debug ALL_BUILD.vcxproj
@if %errorlevel% neq 0 goto error
@MSBuild.exe /nologo /property:Configuration=Debug Bindings\Contents\LUA\PolycodeLua.vcxproj
@if %errorlevel% neq 0 goto error

@MSBuild.exe /nologo /property:Configuration=Release ALL_BUILD.vcxproj
@if %errorlevel% neq 0 goto error
@MSBuild.exe /nologo /property:Configuration=Release Bindings\Contents\LUA\PolycodeLua.vcxproj
@if %errorlevel% neq 0 goto error

@MSBuild.exe /nologo /property:Configuration=Debug INSTALL.vcxproj
@if %errorlevel% neq 0 goto error
@MSBuild.exe /nologo /property:Configuration=Release INSTALL.vcxproj
@if %errorlevel% neq 0 goto error

@rem Build Standalone ----------------------------------------------------------

@cd "%baseDir%"
@if %errorlevel% neq 0 goto error
@cd Standalone
@if %errorlevel% neq 0 goto error

:while3
@if exist Build rmdir /s /q Build
@if exist Build goto while3

@mkdir Build
@if %errorlevel% neq 0 goto error
@cd Build
@if %errorlevel% neq 0 goto error

@cmake -G "%generator%" ..
@if %errorlevel% neq 0 goto error

@MSBuild.exe /nologo /property:Configuration=Release INSTALL.vcxproj
@if %errorlevel% neq 0 goto error

@rem Build IDE -----------------------------------------------------------------

@cd "%baseDir%"
@if %errorlevel% neq 0 goto error
@cd IDE\Build\Windows2013
@if %errorlevel% neq 0 goto error

:while4
@if exist Release rmdir /s /q Release
@if exist x64 rmdir /s /q x64
@if exist Win32 rmdir /s /q Win32
@if exist Release goto while4
@if exist x64 goto while4
@if exist Win32 goto while4

@MSBuild.exe /nologo /property:Configuration=Release /property:Platform=%platform% Polycode.vcxproj
@if %errorlevel% neq 0 goto error

@rem End build -----------------------------------------------------------------

@goto success
:error
@echo:
@echo Build error.
@goto stop

:success
@echo:
@echo Build successful.
@goto stop

:stop
@cd "%baseDir%"
2 changes: 1 addition & 1 deletion Core/Contents/Source/PolyWinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Win32Core::Win32Core(PolycodeViewBase *view, int _xRes, int _yRes, bool fullScre
: Core(_xRes, _yRes, fullScreen, vSync, aaLevel, anisotropyLevel, frameRate, monitorIndex) {

hWnd = *((HWND*)view->windowData);
hInstance = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE);
hInstance = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE);
core = this;
hasCopyDataString = false;

Expand Down