Skip to content

Commit 5602ed5

Browse files
committed
Update openssl build script to support debug | release
1 parent 62eae34 commit 5602ed5

File tree

3 files changed

+52
-60
lines changed

3 files changed

+52
-60
lines changed

Dependencies/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
openssl-install/
1+
openssl-*/

Dependencies/openssl-build.bat

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,32 @@ if "%RUNTIME%" equ "d" copy /y ms\nt.mak ms\nt.mak.orig
3737
:: Release
3838
::
3939

40-
if defined BUILD_RELEASE perl Configure %CONFIGURE% no-asm --prefix=%~dp0\%PLATFORM%-m%RUNTIME%
40+
if defined BUILD_RELEASE rmdir /s /q %~dp0\openssl-%PLATFORM%-m%RUNTIME%
41+
if defined BUILD_RELEASE perl Configure %CONFIGURE% no-asm --prefix=%~dp0\openssl-%PLATFORM%-m%RUNTIME%
4142
if defined BUILD_RELEASE call %SETUP%
4243

4344
if defined BUILD_RELEASE if "%RUNTIME%" equ "d" copy /y ms\nt.mak ms\nt.mak.unhacked
4445
if defined BUILD_RELEASE if "%RUNTIME%" equ "d" perl -p -e "s/\/MT/\/MD/g" ms\nt.mak.unhacked > ms\nt.mak
4546

4647
if defined BUILD_RELEASE nmake -f ms\nt.mak
4748
if defined BUILD_RELEASE nmake -f ms\nt.mak install
48-
if defined BUILD_RELEASE copy /y tmp32\lib.pdb %~dp0\%PLATFORM%-m%RUNTIME%\lib\
49+
if defined BUILD_RELEASE copy /y tmp32\lib.pdb %~dp0\openssl-%PLATFORM%-m%RUNTIME%\lib\
4950
if defined BUILD_RELEASE nmake -f ms\nt.mak clean
5051

5152
::
5253
:: Debug
5354
::
5455

55-
if defined BUILD_DEBUG perl Configure debug-%CONFIGURE% no-asm --prefix=%~dp0\%PLATFORM%-m%RUNTIME%d
56+
if defined BUILD_DEBUG rmdir /s /q %~dp0\openssl-%PLATFORM%-m%RUNTIME%d
57+
if defined BUILD_DEBUG perl Configure debug-%CONFIGURE% no-asm --prefix=%~dp0\openssl-%PLATFORM%-m%RUNTIME%d
5658
if defined BUILD_DEBUG call %SETUP%
5759

5860
if defined BUILD_DEBUG if "%RUNTIME%" equ "d" copy /y ms\nt.mak ms\nt.mak.unhacked
5961
if defined BUILD_DEBUG if "%RUNTIME%" equ "d" perl -p -e "s/\/MT/\/MD/g" ms\nt.mak.unhacked > ms\nt.mak
6062

6163
if defined BUILD_DEBUG nmake -f ms\nt.mak
6264
if defined BUILD_DEBUG nmake -f ms\nt.mak install
63-
if defined BUILD_DEBUG copy /y tmp32.dbg\lib.pdb %~dp0\%PLATFORM%-m%RUNTIME%d\lib\
65+
if defined BUILD_DEBUG copy /y tmp32.dbg\lib.pdb %~dp0\openssl-%PLATFORM%-m%RUNTIME%d\lib\
6466
if defined BUILD_DEBUG nmake -f ms\nt.mak clean
6567

6668
::
@@ -78,20 +80,4 @@ git clean -fdx
7880

7981
popd
8082

81-
pushd %~dp0
82-
83-
if exist openssl-install attrib -r openssl-install\*.* /s
84-
if exist openssl-install rmdir /s /q openssl-install
85-
86-
ren %PLATFORM%-m%RUNTIME%\lib m%RUNTIME%
87-
ren %PLATFORM%-m%RUNTIME%d\lib m%RUNTIME%d
88-
89-
ren %PLATFORM%-m%RUNTIME% openssl-install
90-
mkdir openssl-install\lib\vstudio-%VisualStudioVersion%\%PLATFORM%
91-
move openssl-install\m%RUNTIME% openssl-install\lib\vstudio-%VisualStudioVersion%\%PLATFORM%\
92-
move %PLATFORM%-m%RUNTIME%d\m%RUNTIME%d openssl-install\lib\vstudio-%VisualStudioVersion%\%PLATFORM%\
93-
rmdir /s /q %PLATFORM%-m%RUNTIME%d
94-
95-
popd
96-
9783
endlocal

premake5.lua

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ newoption
2121

2222
architecture( _OPTIONS[ "architecture" ] )
2323

24+
local platform = "x64"
25+
if _OPTIONS[ "architecture" ] == "x86" then
26+
platform = "Win32"
27+
end
28+
2429
flags
2530
{
2631
"FatalWarnings",
@@ -50,11 +55,6 @@ defines
5055
"Z_PREFIX",
5156
}
5257

53-
includedirs
54-
{
55-
"Dependencies/openssl-install/include",
56-
}
57-
5858
buildoptions
5959
{
6060
"/MP",
@@ -112,6 +112,46 @@ configuration "Release"
112112
"/Oi",
113113
}
114114

115+
configuration {"Debug", "x86"}
116+
includedirs
117+
{
118+
"Dependencies/openssl-Win32-mdd/include",
119+
}
120+
libdirs
121+
{
122+
"Dependencies/openssl-Win32-mdd/lib"
123+
}
124+
125+
configuration {"not Debug", "x86"}
126+
includedirs
127+
{
128+
"Dependencies/openssl-Win32-md/include",
129+
}
130+
libdirs
131+
{
132+
"Dependencies/openssl-Win32-md/lib"
133+
}
134+
135+
configuration {"Debug", "x86_64"}
136+
includedirs
137+
{
138+
"Dependencies/openssl-x64-mdd/include",
139+
}
140+
libdirs
141+
{
142+
"Dependencies/openssl-x64-mdd/lib"
143+
}
144+
145+
configuration {"not Debug", "x86_64"}
146+
includedirs
147+
{
148+
"Dependencies/openssl-x64-md/include",
149+
}
150+
libdirs
151+
{
152+
"Dependencies/openssl-x64-md/lib"
153+
}
154+
115155
configuration {}
116156

117157
-- workspace
@@ -426,11 +466,6 @@ project "p4"
426466
"Dependencies/p4/zlib",
427467
}
428468

429-
local platform = "x64"
430-
if _OPTIONS[ "architecture" ] == "x86" then
431-
platform = "Win32"
432-
end
433-
434469
files
435470
{
436471
"Dependencies/p4/client/clientmain.*",
@@ -453,18 +488,6 @@ project "p4"
453488
"setargv.obj",
454489
}
455490

456-
configuration "Debug"
457-
libdirs
458-
{
459-
"Dependencies/openssl-install/lib/vstudio-$(VisualStudioVersion)/" .. platform .. "/mdd"
460-
}
461-
462-
configuration "not Debug"
463-
libdirs
464-
{
465-
"Dependencies/openssl-install/lib/vstudio-$(VisualStudioVersion)/" .. platform .. "/md"
466-
}
467-
468491
project "P4Win"
469492

470493
kind "WindowedApp"
@@ -507,11 +530,6 @@ project "P4Win"
507530
"Source/gui/OptionsDlg",
508531
}
509532

510-
local platform = "x64"
511-
if _OPTIONS[ "architecture" ] == "x86" then
512-
platform = "Win32"
513-
end
514-
515533
files
516534
{
517535
"Source/common/**.cpp",
@@ -556,15 +574,3 @@ project "P4Win"
556574
"wininet",
557575
"winmm",
558576
}
559-
560-
configuration "Debug"
561-
libdirs
562-
{
563-
"Dependencies/openssl-install/lib/vstudio-$(VisualStudioVersion)/" .. platform .. "/mdd"
564-
}
565-
566-
configuration "not Debug"
567-
libdirs
568-
{
569-
"Dependencies/openssl-install/lib/vstudio-$(VisualStudioVersion)/" .. platform .. "/md"
570-
}

0 commit comments

Comments
 (0)