I tested this on Windows 10 machine installed with WSL 1 of Ubuntu 20.04. The guide listed in this section is to “ Cross-compile both CMake and PDCurses with mingw64 for Windows on Linux”. So now as we chose approach 2 to tackle the problem. So the guideline you will be seeing next bases on that. Chosen ApproachĪpproach 2 is the best, and also is a recommended way to proceed with what we want to do here. Interested users who want to test it out themselves can take my patch for compiling both CMake, and PDCurses with MSVC here.Īt last I’m going with mingw64 version. They wouldn’t list it there if there’s something really broken with cross-compilation process. To reassure slightly more, check README.rst in which it mentions about using mingw as one of a couple ways to build. So it’s clear for me which one to choose. Other than that, they both work fine the same. But sadly, its performance is much slower than mingw64 version in approach 2 especially it takes longer time in configuring, and generating project significantly. Thus the build command would be cmd.exe /c nmake -f Makefile.vcĬheck README.md for more detail. This means there is no need to specify DLL=Y. One thing to note is to build it as static library in order to make it compatible and ease in linking with CMake later. Natively compile both CMake and PDCurses with MSVC. That thought became the next approach… 3. If succeed, then we might be able to remove a thin abstraction that it got introduced due to cross-compilation (if ever any). But another thought also came up that I should also do a native compilation with MSVC for both CMake and PDCurses. I’m satisfied with result of this approach, and most likely to call it a day. So navigating through options would work the same as if users do it directly on command prompt or Power Shell. I was able to launch, select & toggle CMake options here and there, then configure and generate a project.Īlthough with some effort to patch PDCurses by tweaking its arrow key codes to make it detectable through WSL, and make its Makefile build system able to do cross-compilation with mingw64. Result is great! I feel like it’s a drop-in replacement for ncurses. Cross-compile both CMake and PDcurses with mingw64 for Windows on Linux. But I made an attempt anyway, so it became next approach… 2. I was slightly worry that it might not be fully compatible, nor provide all the symbols that would be needed by CMake when we compile the source. Next I started seeking for alternative implementation of curses/ncurses but on Windows. Interested users who want to test it out themselves can take my patch for compiling CMake with mingw64 here. Although I tried to debug, but didn’t fully commit to go much further. Result is that I was able to launch it, toggle CMake options here and there, but configuring and generation a project didn’t work at all. Ncurses developers already did this work, so we can trust that the output libraries are in the best form as it can be. I chose to use a pre-built mingw64 version of ncurses due to a lot of pain needed to endure to make it compilable with mingw64. With a small changes to make CMake compatible and buildable with mingw64, then I was able to cross-compile successfully. Cross-compile CMake with mingw64 for Windows on Linux + pre-built mingw64 version of ncurses (mirror on github)įirst attempt was made with assumption that ncurses would work even via cross-compilation to be run on Windows. Here is the chronological order of attempts I’ve made so you will get my thought process. I quickly laid out my game-plan and jump right into action. That dependency is available on Unix/Linux platform only as terminal on Windows does not based on the concept of terminfo/termcap. Not just that ccmake depends on curses or ncurses library. ccmake is configured in upstream CMake source code to be checked and built only if it’s Unix/Linux platform. It’s not that straight forward or a painless process. To bring ccmake from Unix/Linux platform onto Windows. The core question is how can we make ccmake also available on Windows ? Problem ccmake is literally cmake-gui.exe but a command line incarnation. ccmake is the solution here which is available only on Unix/Linux based platform. But you prefer to use command line based solution to configure or generate the project, or quickly adjust options from previously generated CMake project without a need to incrementally execute cmake.exe with bunch of options and lots of flags here and there every now and then. You work on CMake Windows-based project on Windows machine through WSL.Īlthough on Windows, you can already use cmake-gui.exe.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |