philburk / pforth

Portable Forth in C
BSD Zero Clause License
602 stars 99 forks source link

Fix Windows CMAKE Build #150

Closed philburk closed 6 months ago

philburk commented 1 year ago

Use pforth.exe Use cross platform command to move a file. Disable warnings as errors, "/WX". Use some C tricks to prevent compiler warnings.

See Issue #148

philburk commented 1 year ago

I tested the build on Mac by entering:

git fetch origin pull/150/head:fix_win32
git checkout fix_win32
cmake --fresh .
cmake --build .
cd fth
./pforth_standalone t_strings.fth
./pforth_standalone t_floats.fth

It worked fine. PASS

AgitatedAlice commented 1 year ago

$ ninja [18/36] pforth.dic FAILED: fth/pforth.dic C:/msys64/home/45232/pforth/fth/pforth.dic cmd.exe /C "cd /D C:\msys64\home\45232\pforth\fth && .\Debug\pforth.exe -i C:/msys64/home/45232/pfor th/fth/system.fth" The system cannot find the path specified. ninja: build stopped: subcommand failed.

Not even sure which one of these are the wrong path, not sure why cmd is being called when I am in MSYS2, it takes posix commands

philburk commented 1 year ago

@AgitatedAlice - Does the build CMake build work for you? I am not familiar with Ninja.

cmd.exe /C "cd /D C:\msys64\home\45232\pforth\fth && .\Debug\pforth.exe -i C:/msys64/home/45232/pfor th/fth/system.fth"

I notice some of the file separators are "\" and some are "/". Does that matter?

Is there any reason not to merge this PR? Does it work? Does it break anything that currently works?

philburk commented 6 months ago

I did not hear any objections. So I merged it.

I think this code definitely fixes some problems. Hopefully it does not cause new problems.