Browse Source

Fix GameLib test start on Windows

master
Macoy Madson 6 months ago
parent
commit
7eb01b306a
  1. 83
      test/Build.bat
  2. 15
      test/src/GameLibTests.cake

83
test/Build.bat

@ -4,93 +4,30 @@ if not exist "bin" (
mkdir bin
)
rem TODO: Use Build.bat in cakelisp instead of copy-pasting
cd Dependencies/cakelisp
if not exist "bin" (
mkdir bin
)
rem Set environment variables. The user may need to adjust this path
rem See https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-160#developer_command_file_locations
if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" (
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
) else (
if exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" (
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
) else (
echo This script builds using MSVC.
echo You must download and install MSVC before it will work. Download it here:
echo https://visualstudio.microsoft.com/downloads/
echo Select workloads for C++ projects. Ensure you install the C++ developer tools.
echo If you're still seeing this, you may need to edit Build.bat to your vcvars path
echo Please see the following link:
echo https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-160
goto fail
))
if not exist "bin\cakelisp_bootstrap.exe" (
goto manualBuild
) else (
goto bootstrapBuild
if not exist Dependencies/cakelisp (
git clone git@github.com:makuto/cakelisp.git Dependencies/cakelisp
)
:manualBuild
CL.exe src/Tokenizer.cpp ^
src/Evaluator.cpp ^
src/Utilities.cpp ^
src/FileUtilities.cpp ^
src/Converters.cpp ^
src/Writer.cpp ^
src/Generators.cpp ^
src/GeneratorHelpers.cpp ^
src/RunProcess.cpp ^
src/OutputPreambles.cpp ^
src/DynamicLoader.cpp ^
src/ModuleManager.cpp ^
src/Logging.cpp ^
src/Metadata.cpp ^
src/Build.cpp ^
src/Main.cpp ^
/EHsc /MP /DWINDOWS /DCAKELISP_EXPORTING ^
/FS /Fe"bin\cakelisp_bootstrap" /Zi /Fd"bin\cakelisp_bootstrap.pdb" /DEBUG:FASTLINK
echo %ERRORLEVEL%
cd Dependencies/cakelisp
call Build.bat
@if %ERRORLEVEL% == 0 (
echo Success building
rem Clean up working directory
del *.obj
goto bootstrapBuild
echo Success building cakelisp
goto success
) else (
echo Error while building
echo Error while building cakelisp
goto fail
)
:bootstrapBuild
cd ../../
"Dependencies\cakelisp\bin\cakelisp_bootstrap.exe" --verbose-build-reasons src/Config_WindowsBootstrap.cake Dependencies/cakelisp/Bootstrap_MSVC.cake
@if %ERRORLEVEL% == 0 (
echo Success! Use bin\cakelisp.exe to build your programs
goto build_user
) else (
echo Error while bootstrapping cakelisp
goto fail
)
:build_user
rem "bin\cakelisp.exe" --execute --verbose-processes src/Config_Windows.cake src/GameLibTests.cake
"bin\cakelisp.exe" --execute --verbose-processes src/Config_Windows.cake src/Config_WindowsBootstrap.cake ../src/AutoTest.cake ../src/DataBundle.cake
@if %ERRORLEVEL% == 0 (
echo Success!
goto success
) else (
echo Error while building user program
goto fail
)
:fail
goto end
:success
cd ../../
"Dependencies/cakelisp/bin/cakelisp.exe" src/Config_WIndows.cake src/GameLibTests.cake --verbose-processes
goto end
:end

15
test/src/GameLibTests.cake

@ -1,4 +1,5 @@
(set-cakelisp-option cakelisp-src-dir "Dependencies/cakelisp/src")
(set-cakelisp-option cakelisp-lib-dir "Dependencies/cakelisp/bin")
(add-cakelisp-search-directory "Dependencies/cakelisp/runtime")
(import "BuildTools.cake" "ComptimeHelpers.cake" "CHelpers.cake" "Cakelisp.cake")
@ -37,6 +38,12 @@
(true
"src/Config_Linux.cake")))
(comptime-cond
('Windows
(var test-curl-only bool true))
(true
(var test-curl-only bool false)))
(var test-minimal bool true)
;; (var test-minimal bool false)
@ -47,6 +54,14 @@
;; (var test-ogre bool true)
(cond
(test-curl-only
(gamelib-run-test
"Auto Test (CURL only)"
(array platform-config
"../src/AutoTest.cake"
;; Note: Must come before Curl because curl requires openssl
"../src/OpenSSL.cake" "../src/Curl.cake")))
(test-minimal
(gamelib-run-test
"Auto Test (somewhat minimal)"

Loading…
Cancel
Save