Contribution: cross-compile support for Open Watcom

I would like to discuse a cross-compile support for Open Watcom and Linux host support for cross-compilation to DOS, OS/2 and Windows. It includes also cross-compilation for DOS, OS/2 and Linux from Windows host. I plan to do following (any comment and ideas are welcome).

  • I plan to move most of OW stuff to Module/Compiler/* to handle OW tollchain architecture changes, I don’t know if it is supported or deprecated method
  • I plan to add into Module/Platform/* new targets DOS and OS2 definition files required by cross-compilation feature of CMake, I don’t know if it is supported or deprecated method
  • I plan to create DOS-OpenWatcom, OS2-OpenWatcom, Linux-OpenWatcom and appropriate definition for C and C++ compilers.
    What criteria are applied for backward compatibility for new definition?


Cc: @brad.king

@Jiri_Malak that all sounds fine. We can cover details during review. Note that often Platform/* modules can be maintained next to the toolchain file and both externally to CMake. Based on how things look I may ask during review to take some of the parts out. Getting Windows-specific content out of Compiler/* makes sense though.

As for compatibility, this compiler is currently supported only on Windows hosts/targets AFAIK so we just need to make sure that keeps working.

I suppose that windows specific things stay in Platform/* files as now, but some general items common for all targets and architecture should be moved into Compiler/* files. I will prepare new files for Windows first but what will be moved into Compiler/* it will be shared with other platforms.
Anyway one question, CMake implement OW with WCL386 tool, it is only driver that it is inefficient it is middle layer between wmake and compilers. Better should be implement compilers directly from wmake, because wmake has direct interface to compilers (DLL) that use one instance in memory and call compiler directly by internal interface. But it create incompatibility between old (WCL386) and new (WCC/WCC386/WPP/WPP386) implementation (different options, some are same). But if OW stuff will be in Compiler/* files there is no problem switch between old and new implementation.
Probably best will be use old implementation to introduce coross-compilation features and next discuse this change.

I think the option -B build.DOS is source of your problém.

It could be only -B build because it create cross-compilation make file for DOS target and for your host systém (Windows or Linux).

I don’t know if my reply is going to you.

po 26. 7. 2021 v 22:28 odesílatel Bradley Bell via CMake Discourse <> napsal:

Thanks for the response Jiří. I was able to make it work shortly after I posted, and the problem was entirely my fault. Thanks for your work!