Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows (MinGW) #2035

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Windows (MinGW) #2035

wants to merge 25 commits into from

Conversation

karimnaaji
Copy link
Member

@karimnaaji karimnaaji commented Feb 13, 2019

Supersedes PR #1812 (thanks to @tehKaiN for the initial work on this):

  • Add platform layer for Windows platform.
  • Add initial AppVeyor configuration (https://ci.appveyor.com/project/karimnaaji/tangram-es -- currently building my own fork in these logs, but once merged, simply enabling AppVeyor for this repo should work), can be greatly improved by using a docker container having pre-installed dependencies, this initial work builds z-lib and curl from source which isn't the best.
  • Conan wasn't an alternative for the build as it doesn't have dependencies built for MinGW and was failing for unclear reasons when building from source. It could be of use if MSVC is ever supported.
  • curl multi API support hasn't been added yet, still TODO for that PR (added in UrlClient use curl multi api #1994).

@hjanetzek hjanetzek self-assigned this Feb 13, 2019
Copy link
Member

@matteblair matteblair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I managed to get through all the build steps on my Windows machine - building zlib and curl from source isn't the easiest, but it's much better than nothing!

But when I finally got a tangram.exe I was unable to run it:
tangram_exe_error

platforms/windows/README.md Outdated Show resolved Hide resolved
platforms/windows/README.md Show resolved Hide resolved
@karimnaaji
Copy link
Member Author

karimnaaji commented Feb 14, 2019

After the installation of MinGW you should be adding the appropriate path of the MinGW libraries to your PATH. An issue like this is most likely the runtime .dlls not available in your PATH. Did you make that step?

Dependency walker is a great tool to manage and resolve those kind of issues.

@matteblair
Copy link
Member

Success! I got the exe to launch after updating my PATH to include my mingw64 bin folder and my "cmake install" bin folder. Might be worth noting that in the README for troubleshooting.

The next issue was that the file path to the default scene was incorrect at launch:

TANGRAM C:\Users\Matt\Documents\tangram-es\platforms\windows\src\main.cpp:25: Base URL: file://C:\Users\Matt\Documents\tangram-es\build\windows
TANGRAM C:\Users\Matt\Documents\tangram-es\core\src\map.cpp:244: Loading scene file (async): file://C:\Users\Matt\Documents\tangram-es\build\windows/scene.yaml
WARNING C:\Users\Matt\Documents\tangram-es\core\src\platform.cpp:29: Failed to read file at path: /scene.yaml

This was the output from launching either from Command Prompt or by clicking the exe in File Explorer. We might need to adjust the file path logic in WindowsPlatform - I don't think our Url class is able to reformat Windows-style paths.

However, once I corrected the file path manually the scene loaded and rendered! 🎉

@tehKaiN
Copy link

tehKaiN commented Feb 15, 2019

@matteblair @karimnaaji I've hacked around it in one of my commits, In main.cpp

    // Resolve the input path against the current directory.
    Url baseUrl("file:///");
    char pathBuffer[PATH_MAX] = {0};
    if (_getcwd(pathBuffer, PATH_MAX) != nullptr) {
        // URL handler apparently needs slash at end of it
        strcat(pathBuffer, "/");
        baseUrl = Url("file:///" + std::string(pathBuffer)).resolved(baseUrl);
    }

IIRC this fixed path problem for me. Of course proper fix would be better but perhaps it'd guide you to the root of the cause.

@charlenni
Copy link

Any progress in this PR?

@matteblair
Copy link
Member

I've been sadly neglecting this PR for a long time. I had been attempting to create a "native" port that doesn't require MinGW, but it's clear that having a port of some kind is still really valuable! I'll attempt to fix the conflicts in this PR and test it again over the next week.

Base automatically changed from master to main February 15, 2021 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants