Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweaking info text (+11 squashed commits)
Squashed commits: [5d5705b] Add additional guard for reg key value (was throwing) [c999aeb] Guard against non-existant regkey [39bbf63] Helps to use the right operator [ed13668] Put -toolbootstrap at end of net compile command [6d8f715] Support error message if VS2017 registry entry doesn't exist [f13173d] Support Visual Studio Mac [1d39c47] Working on VS2015/VS2017 support [069d705] Adding ide support VS2017 [9ae22cb] Removing some workarounds in root CMake [b166a16] Cleanups for VS2015/VS2017 build [769e74e] Visual Studio 2017 support (WIP)
- Loading branch information
1 parent
82221ed
commit a28af18
Showing
23 changed files
with
1,183 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
var fs = require('fs-extra'); | ||
var path = require("path"); | ||
var host = require("./Host"); | ||
var buildTasks = require("./BuildTasks"); | ||
var config = require("./BuildConfig"); | ||
|
||
const nodeSpawn = require('child_process').spawn; | ||
|
||
var atomicRoot = config.atomicRoot; | ||
var buildDir = config.artifactsRoot + "Build/Windows/"; | ||
var editorAppFolder = config.editorAppFolder | ||
|
||
namespace('build', function() { | ||
|
||
// converts / to \ and removes trailing slash | ||
function fixpath(path) { | ||
return path.replace(/\//g, "\\").replace(/\\$/, ""); | ||
} | ||
|
||
// get CMake flags for generator, vsver parameter can be VS2017/VS2015, etc | ||
function getCMakeFlags(vsver) { | ||
|
||
// local cmake builds are always dev builds | ||
var flags = "-DATOMIC_DEV_BUILD=1"; | ||
|
||
// graphics backend (overrides default DX9) | ||
flags += " -DATOMIC_OPENGL=" + (config["opengl"] ? "ON" : "OFF"); | ||
flags += " -DATOMIC_D3D11=" + (config["d3d11"] ? "ON" : "OFF"); | ||
|
||
return flags; | ||
|
||
} | ||
|
||
// spawn cmake process | ||
function spawnCMake(vsver) { | ||
|
||
host.cleanCreateDir(atomicRoot + "/Artifacts/Build/Source/Generated"); | ||
|
||
var slnRoot = fixpath(path.resolve(atomicRoot, "") + "-" + vsver); | ||
|
||
// we're running cmd.exe, this exits the shell when the command have finished | ||
var args = ["/C"]; | ||
|
||
// Windows batch file which runs cmake | ||
args.push(fixpath(atomicRoot + "\\Build\\Scripts\\Windows\\GenerateVSSolution.bat")); | ||
|
||
// vsver VS2015/VS2017 | ||
args.push(vsver); | ||
|
||
// Atomic root source dir | ||
args.push(fixpath(atomicRoot)); | ||
|
||
// Folder to put generated solution in | ||
args.push(fixpath(slnRoot)); | ||
|
||
// CMake flags | ||
args.push(getCMakeFlags(vsver)); | ||
|
||
// we're using nodeSpawn here instead of jake.exec as the later was having much trouble with quotes | ||
var cmakeProcess = nodeSpawn("cmd.exe", args); | ||
|
||
cmakeProcess.stdout.on('data', (data) => { | ||
process.stdout.write(data.toString()); | ||
}); | ||
|
||
cmakeProcess.stderr.on('data', (data) => { | ||
process.stdout.write(data.toString()); | ||
}); | ||
|
||
cmakeProcess.on('exit', (code) => { | ||
|
||
if (code != 0) { | ||
fail(`CMake process exited with code ${code}`); | ||
} | ||
|
||
console.log("\n\n" + vsver + " solution created in " + fixpath(slnRoot) + "\n\n"); | ||
|
||
complete(); | ||
|
||
}); | ||
|
||
} | ||
|
||
task('genvs2017', { | ||
async: true | ||
}, function() { | ||
|
||
spawnCMake("VS2017"); | ||
|
||
}, { | ||
printStdout: true, | ||
printStderr: true | ||
}); | ||
|
||
// Generate a Visual Studio 2015 solution | ||
task('genvs2015', { | ||
async: true | ||
}, function() { | ||
|
||
spawnCMake("VS2015"); | ||
|
||
}); | ||
|
||
});// end of build namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat" | ||
cmake ..\\..\\..\\ -DATOMIC_DEV_BUILD=0 -G "Visual Studio 14 2015 Win64" | ||
@echo OFF | ||
|
||
call %0\..\SetupVSEnvironment.bat %2 | ||
|
||
if not defined ATOMIC_CMAKE_GENERATOR ( | ||
@echo Problem setting up %2 compilation environment | ||
exit /b 1 | ||
) | ||
|
||
set ATOMIC_CMAKE_FLAGS=%3 | ||
set ATOMIC_CMAKE_FLAGS=%ATOMIC_CMAKE_FLAGS:\=% | ||
set ATOMIC_CMAKE_FLAGS=%ATOMIC_CMAKE_FLAGS:"=% | ||
|
||
%ATOMIC_CMAKE% %0\..\..\..\..\ %ATOMIC_CMAKE_FLAGS% -G %ATOMIC_CMAKE_GENERATOR% | ||
|
||
:: Note, we're building LibCpuId as it uses masm as getting XamlFactory load errors if delayed | ||
msbuild /m Atomic.sln /t:LibCpuId /t:AtomicNETNative /p:Configuration=%1 /p:Platform=x64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat" | ||
@echo OFF | ||
|
||
call %0\..\SetupVSEnvironment.bat %2 | ||
|
||
if not defined ATOMIC_CMAKE_GENERATOR ( | ||
@echo Problem setting up %2 compilation environment | ||
exit /b 1 | ||
) | ||
|
||
msbuild /m Atomic.sln /t:AtomicEditor /t:AtomicPlayer /p:Configuration=%1 /p:Platform=x64 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@echo OFF | ||
|
||
call %0\..\SetupVSEnvironment.bat %1 | ||
|
||
if not defined ATOMIC_CMAKE_GENERATOR ( | ||
@echo Problem setting up %1 compilation environment | ||
exit | ||
) | ||
|
||
@echo OFF | ||
|
||
set ATOMIC_ROOT=%~2 | ||
set ATOMIC_SOLUTION_PATH=%~3 | ||
set ATOMIC_CMAKE_FLAGS="%4" | ||
|
||
%ATOMIC_CMAKE% -E make_directory "%ATOMIC_SOLUTION_PATH%" | ||
%ATOMIC_CMAKE% -E chdir "%ATOMIC_SOLUTION_PATH%" %ATOMIC_CMAKE% "%ATOMIC_ROOT%" %ATOMIC_CMAKE_FLAGS% -G %ATOMIC_CMAKE_GENERATOR% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@echo OFF | ||
|
||
:: locate VS2017, this is done first as inside the conditional was having problems | ||
FOR /F "usebackq tokens=2,* skip=2" %%L IN ( | ||
`reg query ""HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7"" /v 15.0 2^> nul` | ||
) DO (SET ATOMIC_VS2017PATH=%%M) | ||
|
||
if "%1"=="VS2017" ( | ||
|
||
if defined ATOMIC_VS2017PATH ( | ||
|
||
set ATOMIC_CMAKE="%ATOMIC_VS2017PATH%\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" | ||
set ATOMIC_CMAKE_GENERATOR="Visual Studio 15 2017 Win64" | ||
|
||
call "%ATOMIC_VS2017PATH%\Common7\Tools\VsDevCmd.bat" | ||
|
||
) | ||
|
||
) else ( | ||
|
||
if defined VS140COMNTOOLS ( | ||
|
||
set ATOMIC_CMAKE=cmake | ||
set ATOMIC_CMAKE_GENERATOR="Visual Studio 14 2015 Win64" | ||
|
||
call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat" | ||
|
||
) | ||
|
||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.