From 0d0fa21e695f3082576053bf0c9b71a3bcc154a4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 22 May 2018 17:39:36 +0200 Subject: Fix for windows --- backend/ninja/Ninja.cpp | 8 +- include/Conf.hpp | 30 +++--- msvc/LIBEAY32.dll | Bin 0 -> 2283008 bytes msvc/SSLEAY32.dll | Bin 0 -> 361472 bytes msvc/archive.dll | Bin 0 -> 659456 bytes msvc/git2.dll | Bin 0 -> 1124864 bytes msvc/libbz2.dll | Bin 0 -> 70656 bytes msvc/libcharset.dll | Bin 0 -> 10752 bytes msvc/libcurl.dll | Bin 0 -> 285696 bytes msvc/libiconv.dll | Bin 0 -> 937984 bytes msvc/libxml2.dll | Bin 0 -> 1314304 bytes msvc/lz4.dll | Bin 0 -> 94720 bytes msvc/lzma.dll | Bin 0 -> 153088 bytes msvc/sibs.exe | Bin 0 -> 415232 bytes msvc/zlib1.dll | Bin 0 -> 85504 bytes sibs.sln | 31 ++++++ sibs.vcxproj | 186 ++++++++++++++++++++++++++++++++++++ sibs.vcxproj.filters | 249 ++++++++++++++++++++++++++++++++++++++++++++++++ sibs.vcxproj.user | 4 + src/CmakeModule.cpp | 4 +- src/Conf.cpp | 10 +- src/FileUtil.cpp | 3 +- src/GlobalLib.cpp | 8 +- src/Package.cpp | 4 + 24 files changed, 508 insertions(+), 29 deletions(-) create mode 100644 msvc/LIBEAY32.dll create mode 100644 msvc/SSLEAY32.dll create mode 100644 msvc/archive.dll create mode 100644 msvc/git2.dll create mode 100644 msvc/libbz2.dll create mode 100644 msvc/libcharset.dll create mode 100644 msvc/libcurl.dll create mode 100644 msvc/libiconv.dll create mode 100644 msvc/libxml2.dll create mode 100644 msvc/lz4.dll create mode 100644 msvc/lzma.dll create mode 100644 msvc/sibs.exe create mode 100644 msvc/zlib1.dll create mode 100644 sibs.sln create mode 100644 sibs.vcxproj create mode 100644 sibs.vcxproj.filters create mode 100644 sibs.vcxproj.user diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index 06da7c0..7053d43 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -330,10 +330,10 @@ namespace backend cflagsCallbackFunc(pkgConfigFlag.cflags); } #else - for (const Dependency &dependency : dependencies) - { - globalLibDependencies.push_back(dependency); - } + for (PackageListDependency *pkgConfigDependency : packageListDependencies) + { + globalLibDependencies.push_back(pkgConfigDependency); + } #endif return GlobalLib::getLibs(globalLibDependencies, config, globalLibDir, staticLinkerFlagCallbackFunc, dynamicLinkerFlagCallback, globalIncludeDirCallback); diff --git a/include/Conf.hpp b/include/Conf.hpp index 9a9cacf..6018b48 100644 --- a/include/Conf.hpp +++ b/include/Conf.hpp @@ -174,8 +174,8 @@ namespace sibs #define CONFIG_STATIC_DEBUG_PLATFORM 4 #define CONFIG_STATIC_RELEASE_PLATFORM 5 #endif - #define CONFIG_STATIC_LIB_FILE_EXTENSION "lib" - #define CONFIG_DYNAMIC_LIB_FILE_EXTENSION "dll" + #define CONFIG_STATIC_LIB_FILE_EXTENSION L"lib" + #define CONFIG_DYNAMIC_LIB_FILE_EXTENSION L"dll" #elif OS_TYPE == OS_TYPE_LINUX #ifdef SIBS_ENV_32BIT #define SYSTEM_PLATFORM Platform::PLATFORM_LINUX32 @@ -221,10 +221,10 @@ namespace sibs switch(optimizationLevel) { case OPT_LEV_DEBUG: - cmakeArgsGlobal = "-G Ninja \"-DCMAKE_BUILD_TYPE=Debug\""; + cmakeArgsGlobal = TINYDIR_STRING("-G Ninja \"-DCMAKE_BUILD_TYPE=Debug\""); break; case OPT_LEV_RELEASE: - cmakeArgsGlobal = "-G Ninja \"-DCMAKE_BUILD_TYPE=Release\""; + cmakeArgsGlobal = TINYDIR_STRING("-G Ninja \"-DCMAKE_BUILD_TYPE=Release\""); break; } } @@ -326,29 +326,29 @@ namespace sibs } // Get cmake args for all builds. This is args under [cmake] only - const std::string& getCmakeArgs() const + const FileString& getCmakeArgs() const { return cmakeArgsGlobal; } // Get cmake args for static build. This is a combination of args under [cmake] and under [cmake.static] - std::string getCmakeArgsStatic() const + FileString getCmakeArgsStatic() const { - std::string result; + FileString result; result.reserve(cmakeArgsGlobal.size() + 1 + cmakeArgsStatic.size()); result += cmakeArgsGlobal; - result += " "; + result += TINYDIR_STRING(" "); result += cmakeArgsStatic; return result; } // Get cmake args for dynamic build. This is a combination of args under [cmake] and under [cmake.dynamic] - std::string getCmakeArgsDynamic() const + FileString getCmakeArgsDynamic() const { - std::string result; + FileString result; result.reserve(cmakeArgsGlobal.size() + 1 + cmakeArgsDynamic.size()); result += cmakeArgsGlobal; - result += " "; + result += TINYDIR_STRING(" "); result += cmakeArgsDynamic; return result; } @@ -409,7 +409,7 @@ namespace sibs void parsePlatformConfig(const StringView &fieldName, const ConfigValue &fieldValue); void parsePlatformConfigStaticDebug(const StringView &fieldName, const ConfigValue &fieldValue); void parsePlatformConfigStaticRelease(const StringView &fieldName, const ConfigValue &fieldValue); - void parseCmake(const StringView &fieldName, const ConfigValue &fieldValue, std::string &cmakeDir, std::string &cmakeArgs); + void parseCmake(const StringView &fieldName, const ConfigValue &fieldValue, FileString &cmakeDir, FileString &cmakeArgs); void validatePackageName() const; protected: StringView currentObject; @@ -431,9 +431,9 @@ namespace sibs FileString cmakeDirGlobal; FileString cmakeDirStatic; FileString cmakeDirDynamic; - std::string cmakeArgsGlobal; - std::string cmakeArgsStatic; - std::string cmakeArgsDynamic; + FileString cmakeArgsGlobal; + FileString cmakeArgsStatic; + FileString cmakeArgsDynamic; CVersion cVersion; CPPVersion cppVersion; bool useCmake; diff --git a/msvc/LIBEAY32.dll b/msvc/LIBEAY32.dll new file mode 100644 index 0000000..3f1779a Binary files /dev/null and b/msvc/LIBEAY32.dll differ diff --git a/msvc/SSLEAY32.dll b/msvc/SSLEAY32.dll new file mode 100644 index 0000000..2a81ba3 Binary files /dev/null and b/msvc/SSLEAY32.dll differ diff --git a/msvc/archive.dll b/msvc/archive.dll new file mode 100644 index 0000000..1c8983f Binary files /dev/null and b/msvc/archive.dll differ diff --git a/msvc/git2.dll b/msvc/git2.dll new file mode 100644 index 0000000..54d4152 Binary files /dev/null and b/msvc/git2.dll differ diff --git a/msvc/libbz2.dll b/msvc/libbz2.dll new file mode 100644 index 0000000..1bb0b7d Binary files /dev/null and b/msvc/libbz2.dll differ diff --git a/msvc/libcharset.dll b/msvc/libcharset.dll new file mode 100644 index 0000000..3cebd0c Binary files /dev/null and b/msvc/libcharset.dll differ diff --git a/msvc/libcurl.dll b/msvc/libcurl.dll new file mode 100644 index 0000000..ea99c0e Binary files /dev/null and b/msvc/libcurl.dll differ diff --git a/msvc/libiconv.dll b/msvc/libiconv.dll new file mode 100644 index 0000000..4a8d146 Binary files /dev/null and b/msvc/libiconv.dll differ diff --git a/msvc/libxml2.dll b/msvc/libxml2.dll new file mode 100644 index 0000000..f25ae4a Binary files /dev/null and b/msvc/libxml2.dll differ diff --git a/msvc/lz4.dll b/msvc/lz4.dll new file mode 100644 index 0000000..863d4cf Binary files /dev/null and b/msvc/lz4.dll differ diff --git a/msvc/lzma.dll b/msvc/lzma.dll new file mode 100644 index 0000000..48a3d73 Binary files /dev/null and b/msvc/lzma.dll differ diff --git a/msvc/sibs.exe b/msvc/sibs.exe new file mode 100644 index 0000000..44f8871 Binary files /dev/null and b/msvc/sibs.exe differ diff --git a/msvc/zlib1.dll b/msvc/zlib1.dll new file mode 100644 index 0000000..691c689 Binary files /dev/null and b/msvc/zlib1.dll differ diff --git a/sibs.sln b/sibs.sln new file mode 100644 index 0000000..dee6580 --- /dev/null +++ b/sibs.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2018 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sibs", "sibs.vcxproj", "{2C511FA3-FDD5-426D-88B1-29D3A1402CCA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2C511FA3-FDD5-426D-88B1-29D3A1402CCA}.Debug|x64.ActiveCfg = Debug|x64 + {2C511FA3-FDD5-426D-88B1-29D3A1402CCA}.Debug|x64.Build.0 = Debug|x64 + {2C511FA3-FDD5-426D-88B1-29D3A1402CCA}.Debug|x86.ActiveCfg = Debug|Win32 + {2C511FA3-FDD5-426D-88B1-29D3A1402CCA}.Debug|x86.Build.0 = Debug|Win32 + {2C511FA3-FDD5-426D-88B1-29D3A1402CCA}.Release|x64.ActiveCfg = Release|x64 + {2C511FA3-FDD5-426D-88B1-29D3A1402CCA}.Release|x64.Build.0 = Release|x64 + {2C511FA3-FDD5-426D-88B1-29D3A1402CCA}.Release|x86.ActiveCfg = Release|Win32 + {2C511FA3-FDD5-426D-88B1-29D3A1402CCA}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5B182611-D575-40A3-97DA-763A0BC62B84} + EndGlobalSection +EndGlobal diff --git a/sibs.vcxproj b/sibs.vcxproj new file mode 100644 index 0000000..28a2a99 --- /dev/null +++ b/sibs.vcxproj @@ -0,0 +1,186 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {2C511FA3-FDD5-426D-88B1-29D3A1402CCA} + Win32Proj + 10.0.17134.0 + + + + Application + true + v141 + Unicode + + + Application + false + v141 + Unicode + + + Application + true + v141 + + + Application + false + v141 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + + + + + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Console + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sibs.vcxproj.filters b/sibs.vcxproj.filters new file mode 100644 index 0000000..059dfbf --- /dev/null +++ b/sibs.vcxproj.filters @@ -0,0 +1,249 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;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 + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/sibs.vcxproj.user b/sibs.vcxproj.user new file mode 100644 index 0000000..be25078 --- /dev/null +++ b/sibs.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/CmakeModule.cpp b/src/CmakeModule.cpp index 7f517e3..15597cb 100644 --- a/src/CmakeModule.cpp +++ b/src/CmakeModule.cpp @@ -6,7 +6,7 @@ #if OS_FAMILY == OS_FAMILY_POSIX #define nprintf printf #else -#define nprintf wprintf +#define nprintf(fmt, ...) wprintf(TINYDIR_STRING(fmt), __VA_ARGS__) #endif using namespace std; @@ -104,7 +104,7 @@ namespace sibs dynamicLinkerFlagCallbackFunc(pkgConfigLinkerFlagsResult.unwrap()); } #else - for (const Dependency &dependency : dependencies) + for (PackageListDependency *dependency : config.getPackageListDependencies()) { globalLibDependencies.push_back(dependency); } diff --git a/src/Conf.cpp b/src/Conf.cpp index 941bdd7..883022b 100644 --- a/src/Conf.cpp +++ b/src/Conf.cpp @@ -1210,7 +1210,7 @@ namespace sibs failInvalidFieldUnderObject(fieldName); } - void SibsConfig::parseCmake(const StringView &fieldName, const ConfigValue &fieldValue, string &cmakeDir, string &cmakeArgs) + void SibsConfig::parseCmake(const StringView &fieldName, const ConfigValue &fieldValue, FileString &cmakeDir, FileString &cmakeArgs) { if(fieldName.equals("dir")) { @@ -1240,10 +1240,10 @@ namespace sibs bool prependSpace = !cmakeArgs.empty(); cmakeArgs.reserve(cmakeArgs.size() + 4 + (prependSpace ? 1 : 0) + arg.size); if(prependSpace) - cmakeArgs += " "; - cmakeArgs += "\"-D"; - cmakeArgs.append(arg.data, arg.size); - cmakeArgs += "\""; + cmakeArgs += TINYDIR_STRING(" "); + cmakeArgs += TINYDIR_STRING("\"-D"); + cmakeArgs += toFileString(string(arg.data, arg.size)); + cmakeArgs += TINYDIR_STRING("\""); } } else diff --git a/src/FileUtil.cpp b/src/FileUtil.cpp index 5ac2641..53c1132 100644 --- a/src/FileUtil.cpp +++ b/src/FileUtil.cpp @@ -11,6 +11,7 @@ // Copied from linux libc sys/stat.h: #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#pragma comment(lib, "Userenv.lib") #endif using namespace std; @@ -128,7 +129,7 @@ namespace sibs { struct _stat64i32 fileStat; if (_wstat(path, &fileStat) == 0) - rreturn Result::Ok(fileStat.st_mtim.tv_sec); + return Result::Ok(fileStat.st_mtime); else { string errMsg = "File not found: "; diff --git a/src/GlobalLib.cpp b/src/GlobalLib.cpp index c577a4a..9921c1b 100644 --- a/src/GlobalLib.cpp +++ b/src/GlobalLib.cpp @@ -166,8 +166,8 @@ namespace sibs FileString namePlatformNative = gitDependency->name; FileString versionPlatformNative = gitDependency->revision; #else - FileString namePlatformNative = utf8To16(name); - FileString versionPlatformNative = utf8To16(version); + FileString namePlatformNative = utf8To16(gitDependency->name); + FileString versionPlatformNative = utf8To16(gitDependency->revision); #endif FileString packageDir = globalLibRootDir + TINYDIR_STRING("/"); @@ -307,7 +307,11 @@ namespace sibs Result archiveExtractResult = Archive::extract(libArchivedFilePath.c_str(), libPath.c_str()); // We have extracted the archive, we dont need to cache it. If remove fails, it doesn't really matter, user can remove it himself +#if OS_FAMILY == OS_FAMILY_POSIX remove(libArchivedFilePath.c_str()); +#else + _wremove(libArchivedFilePath.c_str()); +#endif return archiveExtractResult; } diff --git a/src/Package.cpp b/src/Package.cpp index 1fa5485..d59c6a9 100644 --- a/src/Package.cpp +++ b/src/Package.cpp @@ -2,6 +2,10 @@ #include "../include/curl.hpp" #include "../external/rapidjson/error/en.h" +#ifdef GetObject +#undef GetObject +#endif + using namespace std; using namespace rapidjson; -- cgit v1.2.3