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 support? #2

Open
oscarbg opened this issue Jul 12, 2019 · 3 comments
Open

Windows support? #2

oscarbg opened this issue Jul 12, 2019 · 3 comments

Comments

@oscarbg
Copy link

oscarbg commented Jul 12, 2019

Hi,
after testing on Linux would like to know how hard to build on Windows..
headless of course..
I changed meson options:
option('present-direct', type: 'feature', value: 'disabled')
option('present-xorg', type: 'feature', value: 'disabled')
and little more of meson buid and I'm able to generate VS project files..
but seems even VS2019 has issues with C++17 templates even changing standard to c++latest..
thanks..

@Snektron
Copy link
Owner

Hello, i haven't tried to compile Xenodon on Windows yet, and i don't have much experience with visual studio. I usually either use MSYS2 or WSL. That said, the code without the xorg/direct backend should be portable enough to get it running. I will try to get a VM spinning and see if i can compile it with VS.

For the record, there is nothing limiting interactive usage on Windows, it's just not implemented. GLFW would seem like the best option to do so because of its cross-platform support, but i opted for using X.org because GLFW does not support creating multiple windows on different GPUs. Currently i have no plans to implement it due to time constraints on my thesis, even though it shouldn't be much work.

@Snektron
Copy link
Owner

Snektron commented Jul 12, 2019

I was not able to get it working, i couldn't get meson to generate a vs project. A friend who i asked to try to compile it on windows with msys reported a few compile errors: notably, on windows std::filesystem::path seems to be a wrapper around std::wstring, instead of std::string, which doesnt work with .c_str() i used to pass it to libtiff. Also it doesnt work with {fmt}, which results in a bunch of template errors. Could those be the same as what you are getting?

@oscarbg
Copy link
Author

oscarbg commented Jul 17, 2019

Hi,
sorry for delay in answering..
will not spend more effort on this.. so just sharing what I did:
modified meson build file
meson.zip
did a change I don't like:
resources.S to resources.txt
it's important?
I'm on VS2019 16.1 and needed latest Meson 0.51 ..
with that you can generate project..

source changes:

#define __PRETTY_FUNCTION__ __FUNCSIG__
#define ssize_t size_t

also trying to avoid template issues:
started commenting code:

//{args::int_range_opt(&opts.render_params.repeat), "frame repeat", "--repeat"}

std::string_view extension = "";// render_params.volume_path.extension().native();

	/*
    template <typename T, typename = std::enable_if_t<std::numeric_limits<T>::is_integer>>
    constexpr auto int_range_opt(T* var, T min = std::numeric_limits<T>::min(), T max = std::numeric_limits<T>::max()) {
        return [var, min, max](std::string_view arg) {
            T value;
            auto [end, err] = std::from_chars(arg.begin(), arg.end(), value);
            if (err != std::errc() || end != arg.end()) {
                return false;
            } else if (value < min || value > max) {
                return false;
            }

            *var = value;
            return true;
        };
    }
	*/

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

No branches or pull requests

2 participants