Keep It Fresh

A software needs to evolve and keep up with trends, especially when that software, like PureBasic, is intended to create other software. Over the past few years, we’ve dedicated a lot of time to fixing many old bugs and updating most of the third-party libraries to their latest versions (Scintilla, libcurl, libjpg, libpng, PCRE, etc.).

When we started working on PureBasic almost 30 years ago, there was no easy way to build these third-party libraries across all operating systems supported by PureBasic. As a result, we decided to write specific makefiles for each library. The problem with custom makefiles is that they can’t automatically track new or removed files, new compiler definitions, and other small specifics, which made updating C libraries difficult. This became a recurring issue for all libraries, and fortunately, CMake was created to solve that. It began to gain real traction around 2010, and nowadays, almost all C libraries have CMake build support, which has greatly simplified keeping third-party libraries up to date, as much of the work is done automatically across all operating systems. You usually only need to run two commands, and the library is built using the native OS compilers (Visual Studio on Windows, Xcode on macOS, and GCC on Linux). We started migrating to CMake a few years ago, which wasn’t exactly an easy task, as the regular makefiles were deeply integrated into the build pipeline, but now it works. For example, LibreSSL is fully built using CMake on all operating systems.

A major component of PureBasic is the 3D Engine, which relies on OGRE. We haven’t updated the engine in 10 years due to the massive scale of OGRE, which has many dependencies, all of which needed to be updated simultaneously (each dependency also had its own custom makefiles). It could take months of work just to get everything up to date across all operating systems, so we decided to postpone this as much as possible. However, with the new experience we gained from CMake, it was time to switch from custom makefiles to native CMake files. After just one week of work, we had a beta version working across all operating systems! The good news is that the update should be virtually seamless, as the dependencies will now be updated automatically. A lot of time was spent updating the PureBasic OGRE wrapper, as many changes occurred over the past 10 years, which wouldn’t have been necessary had the updates been applied regularly.

The next step is to convert all remaining custom makefiles to CMake to ensure that we can keep all libraries fully updated with every new PureBasic release. This will be a significant improvement in terms of security and performance for all applications created with PureBasic !