libsodium-1.0.19-stable.tar.gz
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4490 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
55
deps/libsodium/regen-msvc/regen-msvc.py
vendored
55
deps/libsodium/regen-msvc/regen-msvc.py
vendored
@@ -9,24 +9,24 @@ dirs = set()
|
||||
tlv1 = ""
|
||||
for file in glob.iglob("src/libsodium/**/*.c", recursive=True):
|
||||
file = file.replace("/", "\\")
|
||||
tlv1 = tlv1 + ' <ClCompile Include="{}" />\r\n'.format(file)
|
||||
tlv1 = tlv1 + ' <ClCompile Include="..\\..\\{}" />\r\n'.format(file)
|
||||
|
||||
tlv2 = ""
|
||||
for file in glob.iglob("src/libsodium/**/*.h", recursive=True):
|
||||
file = file.replace("/", "\\")
|
||||
tlv2 = tlv2 + ' <ClInclude Include="{}" />\r\n'.format(file)
|
||||
tlv2 = tlv2 + ' <ClInclude Include="..\\..\\{}" />\r\n'.format(file)
|
||||
|
||||
tlf1 = ""
|
||||
for file in glob.iglob("src/libsodium/**/*.c", recursive=True):
|
||||
file = file.replace("/", "\\")
|
||||
tlf1 = tlf1 + ' <ClCompile Include="{}">\r\n'.format(file)
|
||||
tlf1 = tlf1 + ' <ClCompile Include="..\\..\\{}">\r\n'.format(file)
|
||||
tlf1 = tlf1 + " <Filter>Source Files</Filter>\r\n"
|
||||
tlf1 = tlf1 + " </ClCompile>\r\n"
|
||||
|
||||
tlf2 = ""
|
||||
for file in glob.iglob("src/libsodium/**/*.h", recursive=True):
|
||||
file = file.replace("/", "\\")
|
||||
tlf2 = tlf2 + ' <ClInclude Include="{}">\r\n'.format(file)
|
||||
tlf2 = tlf2 + ' <ClInclude Include="..\\..\\{}">\r\n'.format(file)
|
||||
tlf2 = tlf2 + " <Filter>Header Files</Filter>\r\n"
|
||||
tlf2 = tlf2 + " </ClInclude>\r\n"
|
||||
|
||||
@@ -77,6 +77,39 @@ for dir in dirs:
|
||||
fd = fd + " </Filter>\r\n"
|
||||
|
||||
|
||||
def get_project_configurations(vs_version):
|
||||
projconfig = ""
|
||||
configs = [
|
||||
"DebugDLL",
|
||||
"ReleaseDLL",
|
||||
"DebugLIB",
|
||||
"ReleaseLIB",
|
||||
"DebugLTCG",
|
||||
"ReleaseLTCG",
|
||||
]
|
||||
platforms = ["Win32", "x64"]
|
||||
# add arm64 platform only for v142+ toolchain
|
||||
if vs_version >= 142:
|
||||
platforms.append("ARM64")
|
||||
for config in configs:
|
||||
for platform in platforms:
|
||||
projconfig = (
|
||||
projconfig
|
||||
+ ' <ProjectConfiguration Include="{}|{}">\r\n'.format(
|
||||
config, platform
|
||||
)
|
||||
)
|
||||
projconfig = (
|
||||
projconfig
|
||||
+ " <Configuration>{}</Configuration>\r\n".format(config)
|
||||
)
|
||||
projconfig = projconfig + " <Platform>{}</Platform>\r\n".format(
|
||||
platform
|
||||
)
|
||||
projconfig = projconfig + " </ProjectConfiguration>\r\n"
|
||||
return projconfig
|
||||
|
||||
|
||||
def apply_template(tplfile, outfile, sbox):
|
||||
tpl = ""
|
||||
with open(tplfile, "rb") as fd:
|
||||
@@ -105,11 +138,14 @@ sbox = {
|
||||
sd = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
apply_template(
|
||||
sd + "/tl_libsodium.vcxproj.filters.tpl", "libsodium.vcxproj.filters", sbox
|
||||
sd + "/tl_libsodium.vcxproj.filters.tpl",
|
||||
"ci/appveyor/libsodium.vcxproj.filters",
|
||||
sbox,
|
||||
)
|
||||
|
||||
sbox.update({"platform": "v140"})
|
||||
apply_template(sd + "/tl_libsodium.vcxproj.tpl", "libsodium.vcxproj", sbox)
|
||||
sbox.update({"configurations": get_project_configurations(140)})
|
||||
apply_template(sd + "/tl_libsodium.vcxproj.tpl", "ci/appveyor/libsodium.vcxproj", sbox)
|
||||
|
||||
apply_template(
|
||||
sd + "/libsodium.vcxproj.filters.tpl",
|
||||
@@ -148,6 +184,7 @@ apply_template(
|
||||
)
|
||||
|
||||
sbox.update({"platform": "v143"})
|
||||
sbox.update({"configurations": get_project_configurations(143)})
|
||||
apply_template(
|
||||
sd + "/libsodium.vcxproj.tpl",
|
||||
"builds/msvc/vs2022/libsodium/libsodium.vcxproj",
|
||||
@@ -155,6 +192,7 @@ apply_template(
|
||||
)
|
||||
|
||||
sbox.update({"platform": "v142"})
|
||||
sbox.update({"configurations": get_project_configurations(142)})
|
||||
apply_template(
|
||||
sd + "/libsodium.vcxproj.tpl",
|
||||
"builds/msvc/vs2019/libsodium/libsodium.vcxproj",
|
||||
@@ -162,6 +200,7 @@ apply_template(
|
||||
)
|
||||
|
||||
sbox.update({"platform": "v141"})
|
||||
sbox.update({"configurations": get_project_configurations(141)})
|
||||
apply_template(
|
||||
sd + "/libsodium.vcxproj.tpl",
|
||||
"builds/msvc/vs2017/libsodium/libsodium.vcxproj",
|
||||
@@ -169,6 +208,7 @@ apply_template(
|
||||
)
|
||||
|
||||
sbox.update({"platform": "v140"})
|
||||
sbox.update({"configurations": get_project_configurations(140)})
|
||||
apply_template(
|
||||
sd + "/libsodium.vcxproj.tpl",
|
||||
"builds/msvc/vs2015/libsodium/libsodium.vcxproj",
|
||||
@@ -176,6 +216,7 @@ apply_template(
|
||||
)
|
||||
|
||||
sbox.update({"platform": "v120"})
|
||||
sbox.update({"configurations": get_project_configurations(120)})
|
||||
apply_template(
|
||||
sd + "/libsodium.vcxproj.tpl",
|
||||
"builds/msvc/vs2013/libsodium/libsodium.vcxproj",
|
||||
@@ -183,6 +224,7 @@ apply_template(
|
||||
)
|
||||
|
||||
sbox.update({"platform": "v110"})
|
||||
sbox.update({"configurations": get_project_configurations(110)})
|
||||
apply_template(
|
||||
sd + "/libsodium.vcxproj.tpl",
|
||||
"builds/msvc/vs2012/libsodium/libsodium.vcxproj",
|
||||
@@ -190,6 +232,7 @@ apply_template(
|
||||
)
|
||||
|
||||
sbox.update({"platform": "v100"})
|
||||
sbox.update({"configurations": get_project_configurations(100)})
|
||||
apply_template(
|
||||
sd + "/libsodium.vcxproj.tpl",
|
||||
"builds/msvc/vs2010/libsodium/libsodium.vcxproj",
|
||||
|
Reference in New Issue
Block a user