From b6a11b8b016c5c27a947c3528a70a4a636299aa9 Mon Sep 17 00:00:00 2001 From: Joakim Strandberg Date: Mon, 31 Jul 2023 17:53:01 +0200 Subject: [PATCH] Updated the README.md and updated client.gpr --- wrapper/Ada/README.md | 7 +++++++ wrapper/Ada/client.gpr | 16 ++++++++++++++-- wrapper/Ada/default.gpr | 4 ++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/wrapper/Ada/README.md b/wrapper/Ada/README.md index f1696f261..845dadfaa 100644 --- a/wrapper/Ada/README.md +++ b/wrapper/Ada/README.md @@ -73,6 +73,13 @@ cd obj/ ./tls_client_main 127.0.0.1 ``` +On Windows, build the executables with: +```sh +gprbuild -XOS=Windows default.gpr +gprbuild -XOS=Windows client.gpr +``` + + ### GNAT FSF Compiler and GPRBuild manual installation In May 2022 AdaCore announced the end of the GNAT Community releases. Pre-built binaries for the GNAT FSF compiler and GPRBuild can be diff --git a/wrapper/Ada/client.gpr b/wrapper/Ada/client.gpr index 7590d49d7..cdbf3dedf 100644 --- a/wrapper/Ada/client.gpr +++ b/wrapper/Ada/client.gpr @@ -1,4 +1,8 @@ project Client is + type OS_Kind is ("Windows", "Linux_Or_Mac"); + + OS : OS_Kind := external ("OS", "Linux_Or_Mac"); + for Languages use ("C", "Ada"); for Source_Dirs use (".", @@ -55,8 +59,16 @@ project Client is end Compiler; package Linker is - for Switches ("Ada") use - ("-lm"); -- To include the math library (used by WolfSSL). + case OS is + when "Windows" => + for Switches ("Ada") use + ("-lm", -- To include the math library (used by WolfSSL). + "-lcrypt32"); -- Needed on Windows. + + when "Linux_Or_Mac" => + for Switches ("Ada") use + ("-lm"); -- To include the math library (used by WolfSSL). + end case; end Linker; package Binder is diff --git a/wrapper/Ada/default.gpr b/wrapper/Ada/default.gpr index ac535cad8..bbd3b34f1 100644 --- a/wrapper/Ada/default.gpr +++ b/wrapper/Ada/default.gpr @@ -72,12 +72,12 @@ project Default is package Linker is case OS is - when Windows => + when "Windows" => for Switches ("Ada") use ("-lm", -- To include the math library (used by WolfSSL). "-lcrypt32"); -- Needed on Windows. - when Linux_Or_Mac => + when "Linux_Or_Mac" => for Switches ("Ada") use ("-lm"); -- To include the math library (used by WolfSSL). end case;