From ce7ddd7b176c10478ce369701c9f300550c6b2c3 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Thu, 6 Jan 2022 18:32:22 +0100 Subject: [PATCH] support older meson, fix macos --- .github/workflows/main.yml | 2 +- meson.build | 6 +++--- src/lib/win32/basename.c | 20 +------------------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd7a55e..58c749b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/meson.build b/meson.build index 02d704e..ce90ac8 100644 --- a/meson.build +++ b/meson.build @@ -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 \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') diff --git a/src/lib/win32/basename.c b/src/lib/win32/basename.c index 1b1c0b1..e37d29b 100644 --- a/src/lib/win32/basename.c +++ b/src/lib/win32/basename.c @@ -1,9 +1,8 @@ #include -#include +// 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 -- 2.30.2