Simple Components ODBC bindings on Windows + Alire

Hello!

I have an Alire project that uses the ODBC binding mentioned in the title. It works perfectly under Linux, but it so happened that the final machine it needs to run on uses Windows 10.
I installed Alire on the Windows machine, prepared everything, but I can’t build the project at all:

alr with --solve
Dependencies (direct):
   json^6.0.0
   simple_components^4.7.9
   zlib_ada^1.3.0
Pins (direct):
   json = { path='../json-ada-6.0.0/json' }
   simple_components = { path='../simple_components' }
Dependencies (solution):
   gnat=15.2.1 (gnat_native) (origin: binary_archive)
   json=6.0.0 (pinned) (origin: ../json-ada-6.0.0/json)
   simple_components=4.7.9 (pinned) (origin: ../simple_components)
   zlib=1.3.2 (origin: system)
   zlib_ada=1.3.0 (origin: git)
Dependencies (missing):
   libgnutls^3.7 (indirect,hinted)
   unixodbc^2.3 (indirect,hinted)
Dependencies (graph):
   jm_data_exporter=0.1.0-dev --> json=6.0.0 (^6.0.0)
   jm_data_exporter=0.1.0-dev --> simple_components=4.7.9 (^4.7.9)
   jm_data_exporter=0.1.0-dev --> zlib_ada=1.3.0 (^1.3.0)
   simple_components=4.7.9    --> gnat=15.2.1 (gnat_native) (>=2021 | (>=12 & <2000))
   simple_components=4.7.9    --> libgnutls^3.7
   simple_components=4.7.9    --> unixodbc^2.3
   zlib_ada=1.3.0             --> zlib=1.3.2 (^1.2)

The problem is with libgnutls and unixodbc, but I don’t understand why it’s looking for unixodbc on Windows.
The Simple Components alire.toml file:

name = "simple_components"
description = "Dmitry Kazakov's Simple Components"
version = "4.7.9"
website = "http://www.dmitry-kazakov.de/ada/components.htm"
authors = ["Dmitry Kazakov"]
maintainers = ["piotr.tihanyi@gmail.com"]
maintainers-logins = ["ptihanyi"]
project-files = ["components-connections_server-elv_max_cube.gpr", "components-connections_server-http_server-sqlite_browser.gpr", "components-connections_server-http_server.gpr", "components-connections_server-ldap.gpr", "components-connections_server-modbus.gpr", "components-connections_server-mqtt.gpr", "components-connections_server-openssl.gpr", "components-connections_server-secure.gpr", "components-connections_server-smtp.gpr", "components-connections_server.gpr", "components-gnutls.gpr", "components-json.gpr", "components-julia.gpr", "components-ntp.gpr", "components-odbc.gpr", "components-openssl.gpr", "components-python.gpr", "components-sqlite.gpr", "components.gpr", "strings_edit.gpr", "tables.gpr"]

[[depends-on]]
gnat = ">=2021 | (>=12 & <2000)"
libgnutls = "^3.7"
unixODBC = "^2.3"

[gpr-externals]
Development = ["Debug", "Release", "Profile"] # Default Debug
Driver = ["MySQL", "PostgreSQL", "SyBase", "CT_Lib"] # Default MySQL
Legacy = ["Ada95", "Ada2005", "Ada2012"] # Default Ada2012
Target_OS = ["Windows", "Windows_NT", "Linux", "UNIX", "OSX", "FreeBSD", "auto"] # Default Windows
Tasking = ["Multiple", "Single"] # Default Multiple
Traced_Objects = ["Off", "On"] # Default Off

[gpr-set-externals."case(os)"]
freebsd = { Target_OS = "FreeBSD" }
linux   = { Target_OS = "Linux", odbc = "unixODBC" }
macos   = { Target_OS = "OSX" }
windows = { Target_OS = "Windows", odbc = "ODBC32" }

[gpr-set-externals."case(word-size)"]
bits-32 = { arch = "i686" }
bits-64 = { arch = "x86_64" }

Unfortunately, I don’t know enough about gprbuild to compile the project manually.
Can anyone help? Thanks in advance!

I cannot tell for Alire, but if you download the sources, then there are project scenario variables you must set when you “with” the gpr-file (with "components-odbc.gpr";) in your project’s gpr file: Simple components for Ada. The relevant settings for Windows 64 are these (gprbuild switches):

-Xarch=x86_84
-Xodbc=ODBC32
-XTarget_OS=Windows

Just use the provided gpr-file in your gpr-file:

with "components-odbc.gpr";
project Foo is
   for Main use ("foo.adb");
end Foo;

Set the scenario variables in the GNAT Studio. Or if you use command line then:

gprbuild --Xarch=x86_84 -Xodbc=ODBC32 -XTarget_OS=Windows foo.gpr

You do not need GNUTLS for ODBC. If you want to use GNUTLS the gpr-file is to “with” is “components-gnutls.gpr”.

Thanks!
In the meantime, I realized that the biggest problem is that the alire.toml created for Simple Components includes all .gpr files.
Although my program does not use gnutls, Alire adds all .gpr files to the project config gpr-file with “with”. The .gpr files bring their dependencies with them.
Basically, I like Alire, but I don’t know how to navigate through all the project configuration options yet.
For now, I deleted all .gpr files from the simple components alire.toml file and only included the components-odbc.gpr file. This is neither pretty nor elegant, but it works.