support older meson, fix macos
authorWolf Vollprecht <w.vollprecht@gmail.com>
Thu, 6 Jan 2022 17:32:22 +0000 (18:32 +0100)
committerWolf Vollprecht <w.vollprecht@gmail.com>
Fri, 7 Jan 2022 09:08:36 +0000 (10:08 +0100)
.github/workflows/main.yml
meson.build
src/lib/win32/basename.c

index fd7a55e3433760dfe464287a7ad2df4bad2bf87c..58c749bd2ff37022833b830ab5fca505ca6f716c 100644 (file)
@@ -31,7 +31,7 @@ jobs:
         shell: bash -l {0}
         if: runner.os != 'Windows'
         run: |
-          meson builddir
+          meson builddir --prefix=$CONDA_PREFIX
           cd builddir
           ninja
       - name: Run zchunk tests
index 02d704ea46562e1d48d17a55d86a560fbdc47cd1..ce90ac84b9991635c9163a03709c435f98ea1d38 100644 (file)
@@ -60,10 +60,10 @@ if host_machine.system() == 'windows'
 endif
 
 if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
-   inc += include_directories(get_option('prefix') / 'include')
-   argplib = cc.find_library('argp', dirs : get_option('prefix') / 'lib')
+    inc += include_directories(join_paths([get_option('prefix'), 'include']))
+    argplib = cc.find_library('argp', dirs : join_paths([get_option('prefix'), 'lib']))
 else
-   argplib = dependency('', required : false)
+    argplib = dependency('', required : false)
 endif
 
 subdir('include')
index 1b1c0b1a928853f902d2bf770c687a8c40507789..e37d29b1b3a31e3785cd2ee41a4ea3f259c5bab3 100644 (file)
@@ -1,9 +1,8 @@
 #include <stdio.h>
-#include <windows.h>
 
+// note this is not a proper basename implementation
 char* basename(char* path)
 {
-    // note this is not a proper basename implementation
     char *p = strrchr (path, '\\');
     if (p == NULL)
     {
@@ -11,21 +10,4 @@ char* basename(char* path)
         p = strrchr(path, '/');
     }
     return p ? p + 1 : (char *) path;
-
-    // char full_path[MAX_PATH], drive[MAX_PATH], dir[MAX_PATH], filename[MAX_PATH], ext[MAX_PATH];
-
-    // printf("Input: %s", path);
-
-    // _fullpath(full_path, path, MAX_PATH);
-    // printf("Input: %s", full_path);
-
-    // _splitpath(full_path, drive, dir, filename, ext);
-
-    // printf("%s, %s, %s, %s", drive, dir, filename, ext);
-
-    // const char* res = malloc(MAX_PATH);
-    // sprintf(res, "%s%s", filename, ext);
-    // printf("Result: %s", res);
-
-    // return res;
 }
\ No newline at end of file