diff --git a/regen-msvc/libsodium.vcxproj b/regen-msvc/libsodium.vcxproj new file mode 100644 index 00000000..5aaf8321 --- /dev/null +++ b/regen-msvc/libsodium.vcxproj @@ -0,0 +1,326 @@ + + + + + DebugDLL + Win32 + + + DebugDLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + ReleaseDLL + Win32 + + + ReleaseDLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {A185B162-6CB6-4502-B03F-B56F7699A8D9} + Win32Proj + libsodium + + + + StaticLibrary + true + MultiByte + false + v140 + + + DynamicLibrary + true + MultiByte + false + v140 + + + StaticLibrary + true + MultiByte + false + v140 + + + DynamicLibrary + true + MultiByte + false + v140 + + + StaticLibrary + false + true + MultiByte + v140 + + + DynamicLibrary + false + true + MultiByte + v140 + + + StaticLibrary + false + true + MultiByte + v140 + + + DynamicLibrary + false + true + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + + + Console + true + + + + + Level3 + + + Full + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + Speed + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + + + Full + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + Speed + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + + + Console + true + true + true + + + + + + + + + + + + diff --git a/regen-msvc/libsodium.vcxproj.filters b/regen-msvc/libsodium.vcxproj.filters new file mode 100644 index 00000000..c78137b7 --- /dev/null +++ b/regen-msvc/libsodium.vcxproj.filters @@ -0,0 +1,23 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + + diff --git a/regen-msvc/libsodium.vcxproj.filters.tpl b/regen-msvc/libsodium.vcxproj.filters.tpl new file mode 100644 index 00000000..18a98fb7 --- /dev/null +++ b/regen-msvc/libsodium.vcxproj.filters.tpl @@ -0,0 +1,35 @@ + + + + + packaging + + + packaging + + + packaging + + + packaging + + + packaging + + + packaging + + + + + + + {{f1}} + + + {{f2}} + + + {{fd}} + + diff --git a/regen-msvc/libsodium.vcxproj.tpl b/regen-msvc/libsodium.vcxproj.tpl new file mode 100644 index 00000000..e8d326c8 --- /dev/null +++ b/regen-msvc/libsodium.vcxproj.tpl @@ -0,0 +1,93 @@ + + + + {A185B162-6CB6-4502-B03F-B56F7699A8D9} + libsodium + {{platform}} + + + + DebugDLL + Win32 + + + ReleaseDLL + Win32 + + + DebugDLL + x64 + + + ReleaseDLL + x64 + + + DebugLTCG + Win32 + + + ReleaseLTCG + Win32 + + + DebugLTCG + x64 + + + ReleaseLTCG + x64 + + + DebugLIB + Win32 + + + ReleaseLIB + Win32 + + + DebugLIB + x64 + + + ReleaseLIB + x64 + + + + StaticLibrary + DynamicLibrary + + + + + + + + + + + + + + + + + + + + {{v1}} + + + {{v2}} + + + + + + + + + + diff --git a/regen-msvc/regen-msvc.py b/regen-msvc/regen-msvc.py new file mode 100755 index 00000000..d73a3a54 --- /dev/null +++ b/regen-msvc/regen-msvc.py @@ -0,0 +1,136 @@ +#! /usr/bin/env python3 + +import fileinput +import glob +import os +import uuid + +dirs = set() + +tlv1 = "" +for file in glob.iglob("src/libsodium/**/*.c", recursive=True): + file = file.replace("/", "\\") + tlv1 = tlv1 + " \r\n".format(file) + +tlv2 = "" +for file in glob.iglob("src/libsodium/**/*.h", recursive=True): + file = file.replace("/", "\\") + tlv2 = tlv2 + " \r\n".format(file) + +tlf1 = "" +for file in glob.iglob("src/libsodium/**/*.c", recursive=True): + file = file.replace("/", "\\") + tlf1 = tlf1 + " \r\n".format(file) + tlf1 = tlf1 + " Source Files\r\n" + tlf1 = tlf1 + " \r\n" + +tlf2 = "" +for file in glob.iglob("src/libsodium/**/*.h", recursive=True): + file = file.replace("/", "\\") + tlf2 = tlf2 + " \r\n".format(file) + tlf2 = tlf2 + " Header Files\r\n" + tlf2 = tlf2 + " \r\n" + +v1 = "" +for file in glob.iglob("src/libsodium/**/*.c", recursive=True): + file = file.replace("/", "\\") + v1 = v1 + \ + " \r\n".format(file) + +v2 = "" +for file in glob.iglob("src/libsodium/**/*.h", recursive=True): + file = file.replace("/", "\\") + v2 = v2 + \ + " \r\n".format(file) + +f1 = "" +for file in glob.iglob("src/libsodium/**/*.c", recursive=True): + basedir = os.path.dirname(file).replace("src/libsodium/", "") + t = basedir + while t != '': + dirs.add(t) + t = os.path.dirname(t) + basedir = basedir.replace("/", "\\") + file = file.replace("/", "\\") + f1 = f1 + " \r\n".format(file) + f1 = f1 + " {}\r\n".format(basedir) + f1 = f1 + " \r\n" + +f2 = "" +for file in glob.iglob("src/libsodium/**/*.h", recursive=True): + basedir = os.path.dirname(file).replace("src/libsodium/", "") + t = basedir + while t != '': + dirs.add(t) + t = os.path.dirname(t) + basedir = basedir.replace("/", "\\") + file = file.replace("/", "\\") + f2 = f2 + " \r\n".format(file) + f2 = f2 + " {}\r\n".format(basedir) + f2 = f2 + " \r\n" + +fd = "" +dirs = list(dirs) +dirs.sort() +for dir in dirs: + dir = dir.replace("/", "\\") + uid = uuid.uuid3(uuid.UUID(bytes=b'LibSodiumMSVCUID'), dir) + fd = fd + " \r\n".format(dir) + fd = fd + \ + " {{{}}}\r\n".format(uid) + fd = fd + " \r\n" + + +def apply_template(tplfile, outfile, sbox): + tpl = "" + with open(tplfile, 'rb') as fd: + tpl = fd.read() + for s in sbox.keys(): + tpl = tpl.replace(str.encode( + "{{" + s + "}}", "utf8"), str.encode(str.strip(sbox[s]), "utf8")) + + with open(outfile, 'wb') as fd: + fd.write(tpl) + +sbox = {"tlv1": tlv1, "tlv2": tlv2, "tlf1": tlf1, "tlf2": tlf2, "v1": v1, + "v2": v2, "f1": f1, "f2": f2, "fd": fd} + +sd = os.path.dirname(os.path.realpath(__file__)) + +apply_template(sd + "/tl_libsodium.vcxproj.filters.tpl", + "libsodium.vcxproj.filters", sbox) + +sbox.update({"platform": "v140"}) +apply_template(sd + "/tl_libsodium.vcxproj.tpl", + "libsodium.vcxproj", sbox) + +apply_template(sd + "/libsodium.vcxproj.filters.tpl", + "builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters", sbox) +apply_template(sd + "/libsodium.vcxproj.filters.tpl", + "builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters", sbox) +apply_template(sd + "/libsodium.vcxproj.filters.tpl", + "builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters", sbox) +apply_template(sd + "/libsodium.vcxproj.filters.tpl", + "builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters", sbox) +apply_template(sd + "/libsodium.vcxproj.filters.tpl", + "builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters", sbox) + +sbox.update({"platform": "v141"}) +apply_template(sd + "/libsodium.vcxproj.tpl", + "builds/msvc/vs2017/libsodium/libsodium.vcxproj", sbox) + +sbox.update({"platform": "v140"}) +apply_template(sd + "/libsodium.vcxproj.tpl", + "builds/msvc/vs2015/libsodium/libsodium.vcxproj", sbox) + +sbox.update({"platform": "v120"}) +apply_template(sd + "/libsodium.vcxproj.tpl", + "builds/msvc/vs2013/libsodium/libsodium.vcxproj", sbox) + +sbox.update({"platform": "v110"}) +apply_template(sd + "/libsodium.vcxproj.tpl", + "builds/msvc/vs2012/libsodium/libsodium.vcxproj", sbox) + +sbox.update({"platform": "v100"}) +apply_template(sd + "/libsodium.vcxproj.tpl", + "builds/msvc/vs2010/libsodium/libsodium.vcxproj", sbox) diff --git a/regen-msvc/tl_libsodium.vcxproj.filters.tpl b/regen-msvc/tl_libsodium.vcxproj.filters.tpl new file mode 100644 index 00000000..1863d086 --- /dev/null +++ b/regen-msvc/tl_libsodium.vcxproj.filters.tpl @@ -0,0 +1,23 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + {{tlf1}} + + + {{tlf2}} + + diff --git a/regen-msvc/tl_libsodium.vcxproj.tpl b/regen-msvc/tl_libsodium.vcxproj.tpl new file mode 100644 index 00000000..72bb16a8 --- /dev/null +++ b/regen-msvc/tl_libsodium.vcxproj.tpl @@ -0,0 +1,331 @@ + + + + + DebugDLL + Win32 + + + DebugDLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + ReleaseDLL + Win32 + + + ReleaseDLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {A185B162-6CB6-4502-B03F-B56F7699A8D9} + Win32Proj + libsodium + + + + StaticLibrary + true + MultiByte + false + {{platform}} + + + DynamicLibrary + true + MultiByte + false + {{platform}} + + + StaticLibrary + true + MultiByte + false + {{platform}} + + + DynamicLibrary + true + MultiByte + false + {{platform}} + + + StaticLibrary + false + true + MultiByte + {{platform}} + + + DynamicLibrary + false + true + MultiByte + {{platform}} + + + StaticLibrary + false + true + MultiByte + {{platform}} + + + DynamicLibrary + false + true + MultiByte + {{platform}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + + + Console + true + + + + + Level3 + + + Full + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + Speed + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + + + Full + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + Speed + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + + + Console + true + true + true + + + + {{tlv1}} + + + {{tlv2}} + + + + + + + + + +