MSVC: Update DLL paths in post-build script

This commit is contained in:
SupSuper 2018-12-19 20:47:51 +00:00 committed by Filippos Karapetis
parent 3091345af3
commit e6a80868c6
5 changed files with 19 additions and 17 deletions

View File

@ -339,7 +339,7 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
// Copy data files to the build folder
project << "\t\t<PostBuildEvent>\n"
"\t\t\t<Message>Copy data files to the build folder</Message>\n"
"\t\t\t<Command>" << getPostBuildEvent(isWin32, setup.createInstaller) << "</Command>\n"
"\t\t\t<Command>" << getPostBuildEvent(isWin32, setup) << "</Command>\n"
"\t\t</PostBuildEvent>\n";
} else if (setup.tests) {
project << "\t\t<PreBuildEvent>\n"

View File

@ -188,7 +188,7 @@ std::string MSVCProvider::getTestPreBuildEvent(const BuildSetup &setup) const {
return "&quot;$(SolutionDir)../../test/cxxtest/cxxtestgen.py&quot; --runner=ParenPrinter --no-std --no-eh -o &quot;$(SolutionDir)test_runner.cpp&quot;" + target;
}
std::string MSVCProvider::getPostBuildEvent(bool isWin32, bool createInstaller) const {
std::string MSVCProvider::getPostBuildEvent(bool isWin32, const BuildSetup &setup) const {
std::string cmdLine = "";
cmdLine = "@echo off\n"
@ -196,12 +196,14 @@ std::string MSVCProvider::getPostBuildEvent(bool isWin32, bool createInstaller)
"echo.\n"
"@call &quot;$(SolutionDir)../../devtools/create_project/scripts/postbuild.cmd&quot; &quot;$(SolutionDir)/../..&quot; &quot;$(OutDir)&quot; ";
cmdLine += (isWin32) ? "x86" : "x64";
cmdLine += (setup.useSDL2) ? "SDL2" : "SDL";
cmdLine += " &quot;%" LIBS_DEFINE "%&quot; ";
cmdLine += " &quot;%" LIBS_DEFINE "%/lib/";
cmdLine += (isWin32) ? "x86" : "x64";
cmdLine += "/$(Configuration)&quot; ";
// Specify if installer needs to be built or not
cmdLine += (createInstaller ? "1" : "0");
cmdLine += (setup.createInstaller ? "1" : "0");
cmdLine += "\n"
"EXIT /B0";

View File

@ -104,12 +104,12 @@ protected:
/**
* Get the command line for copying data files to the build directory.
*
* @param isWin32 Bitness of property file.
* @param createInstaller true to create installer
* @param isWin32 Bitness of property file.
* @param setup Description of the desired build setup.
*
* @return The post build event.
*/
std::string getPostBuildEvent(bool isWin32, bool createInstaller) const;
std::string getPostBuildEvent(bool isWin32, const BuildSetup &setup) const;
};
} // End of CreateProjectTool namespace

View File

@ -4,27 +4,27 @@ REM ---------------------------------------------------------------
REM -- Post-Build Script
REM ---------------------------------------------------------------
REM
REM Copy engine data, themes, translation and required dlls to the
REM Copy engine data and required dlls to the
REM output folder and optionally create an installer
REM
REM Expected parameters
REM Root folder
REM Output folder
REM Architecture
REM SDL version
REM Libs folder
REM Installer ("1" to build, "0" to skip)
if "%~1"=="" goto error_root
if "%~2"=="" goto error_output
if "%~3"=="" goto error_arch
if "%~3"=="" goto error_sdl
if "%~4"=="" goto error_libs
if "%~5"=="" goto error_installer
echo Copying data files
echo.
xcopy /F /Y "%~4/lib/%~3/SDL.dll" "%~2" 1>NUL 2>&1
xcopy /F /Y "%~4/lib/%~3/freetype6.dll" "%~2" 1>NUL 2>&1
xcopy /F /Y "%~4/%~3.dll" "%~2" 1>NUL 2>&1
xcopy /F /Y "%~4/WinSparkle.dll" "%~2" 1>NUL 2>&1
xcopy /F /Y "%~1/backends/vkeybd/packs/vkeybd_default.zip" "%~2" 1>NUL 2>&1
xcopy /F /Y "%~1/backends/vkeybd/packs/vkeybd_small.zip" "%~2" 1>NUL 2>&1
@ -33,7 +33,7 @@ if "%~5"=="0" goto done
echo Running installer script
echo.
@call cscript "%~1/devtools/create_project/scripts/installer.vbs" "%~1" "%~2" "%~3" 1>NUL
@call cscript "%~1/devtools/create_project/scripts/installer.vbs" "%~1" "%~2" 1>NUL
if not %errorlevel% == 0 goto error_script
goto done
@ -45,8 +45,8 @@ goto done
echo Invalid output folder (%~2)!
goto done
:error_arch
echo Invalid arch parameter (was: %~3, allowed: x86, x64)!
:error_sdl
echo Invalid SDL parameter (was: %~3, allowed: SDL, SDL2)!
goto done
:error_libs

View File

@ -171,7 +171,7 @@ void VisualStudioProvider::outputBuildEvents(std::ostream &project, const BuildS
"\t\t\t\tCommandLine=\"" << getPreBuildEvent() << "\"\n"
"\t\t\t/>\n"
"\t\t\t<Tool\tName=\"VCPostBuildEventTool\"\n"
"\t\t\t\tCommandLine=\"" << getPostBuildEvent(isWin32, setup.createInstaller) << "\"\n"
"\t\t\t\tCommandLine=\"" << getPostBuildEvent(isWin32, setup) << "\"\n"
"\t\t\t/>\n";
}