2025-02-19 18:08:55 +00:00
|
|
|
Configuration of the ABI Version for the Fast Light Toolkit (FLTK)
|
2016-02-02 02:59:32 +00:00
|
|
|
------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
FLTK preserves the application binary interface (ABI) throughout
|
2025-03-08 14:19:48 +00:00
|
|
|
patch versions, for instance all 1.4.x versions (x = patch version).
|
2016-02-02 02:59:32 +00:00
|
|
|
|
2025-03-08 14:19:48 +00:00
|
|
|
This basically means that a program compiled and linked with FLTK 1.4.0
|
|
|
|
|
can run with a FLTK shared library (fltk.dll, fltk.so.1.4.x) of a later
|
|
|
|
|
FLTK version 1.4.x, but not with a shared library of FLTK 1.5.0 or later.
|
2016-02-02 02:59:32 +00:00
|
|
|
|
|
|
|
|
Since FLTK 1.3.1 the FLTK team began to introduce ABI-breaking features
|
2025-03-08 14:19:48 +00:00
|
|
|
wrapped in so-called ABI guards in the library code, using a preprocessor
|
|
|
|
|
macro. Since FLTK 1.4.0 the macro name is FL_ABI_VERSION:
|
2016-02-02 02:59:32 +00:00
|
|
|
|
2016-11-19 01:20:53 +00:00
|
|
|
#if FL_ABI_VERSION >= 10401
|
2020-07-01 16:03:10 +00:00
|
|
|
... new, ABI breaking code ...
|
2016-11-19 01:20:53 +00:00
|
|
|
#else
|
2020-07-01 16:03:10 +00:00
|
|
|
... old, ABI preserving code ...
|
2016-11-19 01:20:53 +00:00
|
|
|
#endif
|
2016-02-02 02:59:32 +00:00
|
|
|
|
2025-03-08 14:19:48 +00:00
|
|
|
This documentation was written for FLTK 1.4.x but it applies to all later
|
2016-11-19 01:20:53 +00:00
|
|
|
versions as well. Replace the version numbers given here with the version
|
|
|
|
|
numbers of the version you are using. FLTK version 1.4.1 was chosen as an
|
2025-02-19 18:08:55 +00:00
|
|
|
example only.
|
2016-02-02 02:59:32 +00:00
|
|
|
|
|
|
|
|
|
2025-02-19 18:08:55 +00:00
|
|
|
How to Define the FLTK ABI Version
|
2016-02-02 02:59:32 +00:00
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
|
|
To define the ABI version the preprocessor macro FL_ABI_VERSION must be
|
|
|
|
|
defined as a number representing the ABI version in the form
|
|
|
|
|
|
2016-11-19 01:20:53 +00:00
|
|
|
#define FL_ABI_VERSION 1xxyy
|
2016-02-02 02:59:32 +00:00
|
|
|
|
|
|
|
|
where xx and yy are the minor and patch versions, resp. with leading zeroes,
|
2025-03-08 14:19:48 +00:00
|
|
|
and '1' is the major version number. CMake generates the file FL/fl_config.h
|
|
|
|
|
in the build folder given the version you select (see below).
|
2016-02-02 02:59:32 +00:00
|
|
|
|
2025-03-08 14:19:48 +00:00
|
|
|
For instance, the default ABI version for all FLTK 1.4.x versions is 10400
|
|
|
|
|
(the binary version of FLTK 1.4.0) but you can select another version,
|
|
|
|
|
e.g. 10401 for FLTK 1.4.1 to enable the ABI features of FLTK 1.4.1 and all
|
|
|
|
|
previous versions. The same applies to all higher FLTK versions.
|
2016-02-02 02:59:32 +00:00
|
|
|
|
2025-03-08 14:19:48 +00:00
|
|
|
The default ABI version is always the lowest version (e.g. 10400). All
|
2016-11-19 01:20:53 +00:00
|
|
|
following examples are written for FLTK 1.4.1, hence we use "10401" for
|
2016-02-02 02:59:32 +00:00
|
|
|
the version number.
|
|
|
|
|
|
2025-03-29 20:03:18 +00:00
|
|
|
Note: Since FLTK 1.4.3 (Git branch-1.4 after release 1.4.2) the highest
|
|
|
|
|
selectable ABI version is FL_API_VERSION + 1 so you can use ABI features
|
|
|
|
|
designated for the *next* FLTK release when using FLTK from Git with new
|
|
|
|
|
ABI features included for the next release.
|
|
|
|
|
|
2016-02-02 02:59:32 +00:00
|
|
|
|
2025-03-08 14:19:48 +00:00
|
|
|
How to select the ABI version with CMake
|
|
|
|
|
----------------------------------------
|
2016-02-02 02:59:32 +00:00
|
|
|
|
2025-03-08 14:19:48 +00:00
|
|
|
Use CMake to build the Makefile's and run 'make' or use any other CMake
|
|
|
|
|
generator of your choice. To select the ABI version use one of the CMake
|
|
|
|
|
configuration tools (cmake-gui or ccmake), or run CMake with these or
|
|
|
|
|
similar commands:
|
2016-02-02 02:59:32 +00:00
|
|
|
|
2025-03-08 14:19:48 +00:00
|
|
|
cd /path/to/fltk
|
|
|
|
|
cmake . -B build [-G <GENERATOR>] -D FLTK_ABI_VERSION:STRING=10401
|
2016-02-02 02:59:32 +00:00
|
|
|
|
2025-03-08 14:19:48 +00:00
|
|
|
The optional part '[-G <GENERATOR>]' can be used to select a particular
|
|
|
|
|
build tool that is not the default for the build platform, for instance
|
|
|
|
|
'-G Ninja'. Further CMake options can be appended.
|
2017-07-05 17:15:16 +00:00
|
|
|
|
|
|
|
|
Then execute
|
|
|
|
|
|
2025-03-08 14:19:48 +00:00
|
|
|
cmake --build build
|
2016-02-02 02:59:32 +00:00
|
|
|
|
2025-03-08 14:19:48 +00:00
|
|
|
or the selected build tool (-G <GENERATOR>), e.g. `make`.
|
2016-02-02 02:59:32 +00:00
|
|
|
|
2016-11-19 01:20:53 +00:00
|
|
|
For more information on how to use CMake with FLTK see README.CMake.txt.
|
2016-02-02 02:59:32 +00:00
|
|
|
|
|
|
|
|
|
2025-03-08 14:19:48 +00:00
|
|
|
General Note on CMake
|
|
|
|
|
---------------------
|
2016-02-02 02:59:32 +00:00
|
|
|
|
2021-12-18 21:42:30 +00:00
|
|
|
CMake generates FL/fl_config.h in the build tree. You may run
|
2016-11-19 01:20:53 +00:00
|
|
|
'make install' to install the FLTK library including all headers in
|
2025-02-19 18:08:55 +00:00
|
|
|
the chosen installation directory (set CMAKE_INSTALL_PREFIX to do this),
|
|
|
|
|
although this is not necessary.
|
2016-11-19 01:20:53 +00:00
|
|
|
|
|
|
|
|
The FLTK team recommends to use the FLTK library directly from the
|
|
|
|
|
build folder. See README.CMake.txt for more information.
|