summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-25 19:24:58 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-25 19:24:58 +0000
commit555141e35166c7f7d98c16f6f95fde8e57a651c2 (patch)
treee5cce20d7692b2ba99e68ed46ae545ea8923b94c /src/utils
parentd5ad18ff3b97515c12a35f00d940e62bb34b7401 (diff)
Implement runtime OS detection and automatic versioningv0.1.2
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/utils.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/utils/utils.c b/src/utils/utils.c
index 159326e..56a7690 100644
--- a/src/utils/utils.c
+++ b/src/utils/utils.c
@@ -671,14 +671,17 @@ void scan_build_directives(ParserContext *ctx, const char *src)
{
printf("[zprep] Downloading %s...\n", filename);
char cmd[8192];
-#ifdef _WIN32
- // On Windows, try curl which is often built-in now
- sprintf(cmd, "curl -s -L \"%s\" -o \"%s\"", url, filename);
-#else
- // Try wget, then curl.
- sprintf(cmd, "wget -q \"%s\" -O \"%s\" || curl -s -L \"%s\" -o \"%s\"", url,
- filename, url, filename);
-#endif
+ if (z_is_windows())
+ {
+ // On Windows, try curl which is often built-in now
+ sprintf(cmd, "curl -s -L \"%s\" -o \"%s\"", url, filename);
+ }
+ else
+ {
+ // Try wget, then curl.
+ sprintf(cmd, "wget -q \"%s\" -O \"%s\" || curl -s -L \"%s\" -o \"%s\"", url,
+ filename, url, filename);
+ }
if (system(cmd) != 0)
{
zwarn("Failed to download %s", url);
@@ -693,11 +696,12 @@ void scan_build_directives(ParserContext *ctx, const char *src)
libs++;
}
-#ifdef _WIN32
- zwarn("pkg-config is usually not available on Windows. Build directive "
- "'pkg-config:%s' might fail.",
- libs);
-#endif
+ if (z_is_windows())
+ {
+ zwarn("pkg-config is usually not available on Windows. Build directive "
+ "'pkg-config:%s' might fail.",
+ libs);
+ }
char cmd[4096];
sprintf(cmd, "pkg-config --cflags %s", libs);