gphalkes / tilde

The Tilde text editor
395 stars 21 forks source link

Windows port #101

Open efa opened 1 year ago

efa commented 1 year ago

Did exist a version for MS Windows? Compiled with Cygwin or even MinGW/Msys2 ?

Are you interested in such port?

efa commented 1 year ago

I made some tests with Cygwin as it is easier to port something than MinGW/MSYS2.

With some simple patches (back compatible with Debian 11) I can build the following libs:

transcript
t3config
t3key
t3highlight
t3window

while for t3widgets seems it depends strictly on libgpm-dev (on Linux too) and as now I cannot build it, and so cannot build tilde package.

Any suggestions?

efa commented 1 year ago

without:

CXXFLAGS += -DHAS_GPM
LDLIBS.libt3widget.la += -lgpm

in t3widgets/src/Makefile I got this error:

[CXXLT] clipboard.cc
In file included from clipboard.cc:35:
internal.h:129:22: error: variable or field 'fd_set_mouse_fd' declared void
  129 | T3_WIDGET_LOCAL void fd_set_mouse_fd(fd_set *readset, int *max_fd);
      |                      ^~~~~~~~~~~~~~~
internal.h:129:38: error: 'fd_set' was not declared in this scope
  129 | T3_WIDGET_LOCAL void fd_set_mouse_fd(fd_set *readset, int *max_fd);
      |                                      ^~~~~~
internal.h:129:46: error: 'readset' was not declared in this scope
  129 | T3_WIDGET_LOCAL void fd_set_mouse_fd(fd_set *readset, int *max_fd);
      |                                              ^~~~~~~

probably because t3widgets/src/internal.h at line 129 has:

T3_WIDGET_LOCAL void fd_set_mouse_fd(fd_set *readset, int *max_fd);

and fd_set_mouse_fd, fd_set and readset are not resolved on Cygwin.

Adding unconditional (seems HAS_SELECT_H is not defined on Cygwin):

include <sys/select.h>

to internal.h file clipboard.cc compile, but compilation end with another error on key.cc Will made other tests

Note: On Debian removing

CXXFLAGS += -DHAS_GPM
LDLIBS.libt3widget.la += -lgpm

build always work

efa commented 1 year ago

t3widgets now compile.

tilde build immediately stop:

...
[CXX] attributemap.cc

../../t3shared/../t3shared/include/t3widget/string_view.h:323:58: error: declaration of 'constexpr const size_type t3widget::basic_string_view<CharT, Traits>::npos' outside of class is not definition [-fpermissive]
  323 |     basic_string_view<CharT, Traits>::size_type basic_string_view<CharT, Traits>::npos;
      |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gphalkes commented 1 year ago

It seems there was a bug in the t3wdiget/string_view.h header, which was permitted in some cases but not with some more strict settings of the compiler. I've removed the offending definition so if you sync your t3shared repository, this error should no longer occur.

efa commented 1 year ago

goes over to string_view.h:323 after many warning, building tilde I got this other error:

../../t3shared/../t3shared/include/t3widget/string_view.h:502:50: error: function 'basic_ostream<_CharT, _Traits> & t3widget::operator<<(basic_ostream<_CharT, _Traits> &, t3widget::basic_string_view<CharT, Traits>)' definition is marked dllimport
  502 | T3_WIDGET_API basic_ostream<CharT, Traits> &operator<<(basic_ostream<CharT, Traits> &os,
      |                                                  ^~~~~~~~
make: *** [../../makesys/rules.mk:327: .objects/attributemap.o] Error 1

sorry my level of C++ is 1%