Support for Windows builds
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2019-08-11 16:05:14 +02:00
parent 641b6784c7
commit ece9c1f5eb
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
8 changed files with 24 additions and 14 deletions

View File

@ -17,9 +17,13 @@ steps:
- build-release/PorygonLangTests -s --durations yes --use-colour yes - build-release/PorygonLangTests -s --durations yes --use-colour yes
- valgrind --tool=memcheck --gen-suppressions=all --leak-check=full --leak-resolution=med --track-origins=yes --vgdb=no --error-exitcode=1 build-release/PorygonLangTests - valgrind --tool=memcheck --gen-suppressions=all --leak-check=full --leak-resolution=med --track-origins=yes --vgdb=no --error-exitcode=1 build-release/PorygonLangTests
# - name: test-release-windows - name: test-release-windows
# image: deukhoofd/dockcross-windows image: deukhoofd/windowsbuilder
# commands: commands:
# - cmake -DCMAKE_BUILD_TYPE=Release . -B build-release - update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
# - cmake --build build-release --target all -- -j 4 - update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
# - build-release/PorygonLangTests -s - update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
- update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
- cmake -DCMAKE_BUILD_TYPE=Release . -B build-release -D
- cmake --build build-release-windows --target all -- -j 4
- wine build-release-windows/PorygonLangTests.exe -s

View File

@ -14,4 +14,9 @@ add_executable(PorygonLangTests
${SRC_FILES} ${SRC_FILES}
${TEST_FILES}) ${TEST_FILES})
if (WINDOWS)
target_link_libraries(PorygonLang -static)
target_link_libraries(PorygonLangTests -static)
endif(WINDOWS)
target_compile_definitions(PorygonLangTests PRIVATE TESTS_BUILD) target_compile_definitions(PorygonLangTests PRIVATE TESTS_BUILD)

View File

@ -12,7 +12,7 @@
using namespace std; using namespace std;
namespace Porygon::Binder { namespace Porygon::Binder {
enum class BoundExpressionKind : u_int8_t { enum class BoundExpressionKind : uint8_t {
Bad, Bad,
LiteralInteger, LiteralInteger,

View File

@ -10,7 +10,7 @@
using namespace std; using namespace std;
namespace Porygon::Binder { namespace Porygon::Binder {
enum class BoundStatementKind : u_int8_t { enum class BoundStatementKind : uint8_t {
Bad, Bad,
Break, Break,
Script, Script,

View File

@ -3,7 +3,7 @@
#define PORYGONLANG_DIAGNOSTICCODE_HPP #define PORYGONLANG_DIAGNOSTICCODE_HPP
namespace Porygon::Diagnostics { namespace Porygon::Diagnostics {
enum class DiagnosticCode : u_int8_t { enum class DiagnosticCode : uint8_t {
// Lex diagnostics // Lex diagnostics
UnexpectedCharacter, UnexpectedCharacter,
InvalidStringControlCharacter, InvalidStringControlCharacter,

View File

@ -9,7 +9,7 @@
namespace Porygon{ namespace Porygon{
struct EvaluateResult{ struct EvaluateResult{
const Evaluation::EvalValue* _value; const Evaluation::EvalValue* _value;
const u_int8_t _result; const uint8_t _result;
char * _errorMessage; char * _errorMessage;
const size_t _errorSize; const size_t _errorSize;
public: public:
@ -38,7 +38,7 @@ namespace Porygon{
return _value; return _value;
} }
[[nodiscard]] u_int8_t GetResult() const{ [[nodiscard]] uint8_t GetResult() const{
return _result; return _result;
} }

View File

@ -1,6 +1,6 @@
#include <iostream> #include <iostream>
#include <filesystem>
#include <fstream> #include <fstream>
#include <sys/stat.h>
#include "ScriptOptions.hpp" #include "ScriptOptions.hpp"
#include "Utilities/StringUtils.hpp" #include "Utilities/StringUtils.hpp"
#include "Script.hpp" #include "Script.hpp"
@ -15,7 +15,8 @@ void Porygon::ScriptOptions::DefaultPrint(const char16_t *s) {
} }
bool Porygon::ScriptOptions::DefaultModuleExists(const std::string& moduleName) { bool Porygon::ScriptOptions::DefaultModuleExists(const std::string& moduleName) {
return std::filesystem::exists(moduleName); struct stat buffer;
return (stat (moduleName.c_str(), &buffer) == 0);
} }
Porygon::Script *Porygon::ScriptOptions::DefaultResolveModule(const std::string& moduleName) { Porygon::Script *Porygon::ScriptOptions::DefaultResolveModule(const std::string& moduleName) {

View File

@ -3,8 +3,8 @@
#define PORYGONLANG_USERDATASTORAGE_HPP #define PORYGONLANG_USERDATASTORAGE_HPP
#include <unordered_map> #include <unordered_map>
#include <mutex>
#include "UserData.hpp" #include "UserData.hpp"
#include <mutex>
namespace Porygon::UserData { namespace Porygon::UserData {
class UserDataStorage { class UserDataStorage {