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
- 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
# image: deukhoofd/dockcross-windows
# commands:
# - cmake -DCMAKE_BUILD_TYPE=Release . -B build-release
# - cmake --build build-release --target all -- -j 4
# - build-release/PorygonLangTests -s
- name: test-release-windows
image: deukhoofd/windowsbuilder
commands:
- update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
- update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
- 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}
${TEST_FILES})
if (WINDOWS)
target_link_libraries(PorygonLang -static)
target_link_libraries(PorygonLangTests -static)
endif(WINDOWS)
target_compile_definitions(PorygonLangTests PRIVATE TESTS_BUILD)

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
#include <iostream>
#include <filesystem>
#include <fstream>
#include <sys/stat.h>
#include "ScriptOptions.hpp"
#include "Utilities/StringUtils.hpp"
#include "Script.hpp"
@ -15,7 +15,8 @@ void Porygon::ScriptOptions::DefaultPrint(const char16_t *s) {
}
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) {

View File

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