diff --git a/Dependencies/.gitignore b/Dependencies/.gitignore index 31d39e8..6895250 100644 --- a/Dependencies/.gitignore +++ b/Dependencies/.gitignore @@ -1 +1 @@ -openssl-install/ \ No newline at end of file +openssl-*/ \ No newline at end of file diff --git a/Dependencies/openssl-build.bat b/Dependencies/openssl-build.bat index ab45be6..9b32f61 100644 --- a/Dependencies/openssl-build.bat +++ b/Dependencies/openssl-build.bat @@ -37,7 +37,8 @@ if "%RUNTIME%" equ "d" copy /y ms\nt.mak ms\nt.mak.orig :: Release :: -if defined BUILD_RELEASE perl Configure %CONFIGURE% no-asm --prefix=%~dp0\%PLATFORM%-m%RUNTIME% +if defined BUILD_RELEASE rmdir /s /q %~dp0\openssl-%PLATFORM%-m%RUNTIME% +if defined BUILD_RELEASE perl Configure %CONFIGURE% no-asm --prefix=%~dp0\openssl-%PLATFORM%-m%RUNTIME% if defined BUILD_RELEASE call %SETUP% if defined BUILD_RELEASE if "%RUNTIME%" equ "d" copy /y ms\nt.mak ms\nt.mak.unhacked @@ -45,14 +46,15 @@ if defined BUILD_RELEASE if "%RUNTIME%" equ "d" perl -p -e "s/\/MT/\/MD/g" ms\nt if defined BUILD_RELEASE nmake -f ms\nt.mak if defined BUILD_RELEASE nmake -f ms\nt.mak install -if defined BUILD_RELEASE copy /y tmp32\lib.pdb %~dp0\%PLATFORM%-m%RUNTIME%\lib\ +if defined BUILD_RELEASE copy /y tmp32\lib.pdb %~dp0\openssl-%PLATFORM%-m%RUNTIME%\lib\ if defined BUILD_RELEASE nmake -f ms\nt.mak clean :: :: Debug :: -if defined BUILD_DEBUG perl Configure debug-%CONFIGURE% no-asm --prefix=%~dp0\%PLATFORM%-m%RUNTIME%d +if defined BUILD_DEBUG rmdir /s /q %~dp0\openssl-%PLATFORM%-m%RUNTIME%d +if defined BUILD_DEBUG perl Configure debug-%CONFIGURE% no-asm --prefix=%~dp0\openssl-%PLATFORM%-m%RUNTIME%d if defined BUILD_DEBUG call %SETUP% if defined BUILD_DEBUG if "%RUNTIME%" equ "d" copy /y ms\nt.mak ms\nt.mak.unhacked @@ -60,7 +62,7 @@ if defined BUILD_DEBUG if "%RUNTIME%" equ "d" perl -p -e "s/\/MT/\/MD/g" ms\nt.m if defined BUILD_DEBUG nmake -f ms\nt.mak if defined BUILD_DEBUG nmake -f ms\nt.mak install -if defined BUILD_DEBUG copy /y tmp32.dbg\lib.pdb %~dp0\%PLATFORM%-m%RUNTIME%d\lib\ +if defined BUILD_DEBUG copy /y tmp32.dbg\lib.pdb %~dp0\openssl-%PLATFORM%-m%RUNTIME%d\lib\ if defined BUILD_DEBUG nmake -f ms\nt.mak clean :: @@ -78,20 +80,4 @@ git clean -fdx popd -pushd %~dp0 - -if exist openssl-install attrib -r openssl-install\*.* /s -if exist openssl-install rmdir /s /q openssl-install - -ren %PLATFORM%-m%RUNTIME%\lib m%RUNTIME% -ren %PLATFORM%-m%RUNTIME%d\lib m%RUNTIME%d - -ren %PLATFORM%-m%RUNTIME% openssl-install -mkdir openssl-install\lib\vstudio-%VisualStudioVersion%\%PLATFORM% -move openssl-install\m%RUNTIME% openssl-install\lib\vstudio-%VisualStudioVersion%\%PLATFORM%\ -move %PLATFORM%-m%RUNTIME%d\m%RUNTIME%d openssl-install\lib\vstudio-%VisualStudioVersion%\%PLATFORM%\ -rmdir /s /q %PLATFORM%-m%RUNTIME%d - -popd - endlocal diff --git a/premake5.lua b/premake5.lua index 57a72b0..1785805 100644 --- a/premake5.lua +++ b/premake5.lua @@ -21,6 +21,11 @@ newoption architecture( _OPTIONS[ "architecture" ] ) +local platform = "x64" +if _OPTIONS[ "architecture" ] == "x86" then + platform = "Win32" +end + flags { "FatalWarnings", @@ -50,11 +55,6 @@ defines "Z_PREFIX", } -includedirs -{ - "Dependencies/openssl-install/include", -} - buildoptions { "/MP", @@ -112,6 +112,46 @@ configuration "Release" "/Oi", } +configuration {"Debug", "x86"} + includedirs + { + "Dependencies/openssl-Win32-mdd/include", + } + libdirs + { + "Dependencies/openssl-Win32-mdd/lib" + } + +configuration {"not Debug", "x86"} + includedirs + { + "Dependencies/openssl-Win32-md/include", + } + libdirs + { + "Dependencies/openssl-Win32-md/lib" + } + +configuration {"Debug", "x86_64"} + includedirs + { + "Dependencies/openssl-x64-mdd/include", + } + libdirs + { + "Dependencies/openssl-x64-mdd/lib" + } + +configuration {"not Debug", "x86_64"} + includedirs + { + "Dependencies/openssl-x64-md/include", + } + libdirs + { + "Dependencies/openssl-x64-md/lib" + } + configuration {} -- workspace @@ -426,11 +466,6 @@ project "p4" "Dependencies/p4/zlib", } - local platform = "x64" - if _OPTIONS[ "architecture" ] == "x86" then - platform = "Win32" - end - files { "Dependencies/p4/client/clientmain.*", @@ -453,18 +488,6 @@ project "p4" "setargv.obj", } - configuration "Debug" - libdirs - { - "Dependencies/openssl-install/lib/vstudio-$(VisualStudioVersion)/" .. platform .. "/mdd" - } - - configuration "not Debug" - libdirs - { - "Dependencies/openssl-install/lib/vstudio-$(VisualStudioVersion)/" .. platform .. "/md" - } - project "P4Win" kind "WindowedApp" @@ -507,11 +530,6 @@ project "P4Win" "Source/gui/OptionsDlg", } - local platform = "x64" - if _OPTIONS[ "architecture" ] == "x86" then - platform = "Win32" - end - files { "Source/common/**.cpp", @@ -556,15 +574,3 @@ project "P4Win" "wininet", "winmm", } - - configuration "Debug" - libdirs - { - "Dependencies/openssl-install/lib/vstudio-$(VisualStudioVersion)/" .. platform .. "/mdd" - } - - configuration "not Debug" - libdirs - { - "Dependencies/openssl-install/lib/vstudio-$(VisualStudioVersion)/" .. platform .. "/md" - }