From 7acb809eef99b923149a3efa088aba05f3aaffca Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Mon, 30 Jun 2025 23:41:12 +0200 Subject: [PATCH] Do not try to compile Python code when building other bindings Fixes the issue reported by @dl8fcl https://github.com/Hamlib/Hamlib/commit/f7d38f92cac73fb8b952f5dde3853f40ef910e14#commitcomment-161078321 --- bindings/amplifier.swg | 3 ++- bindings/rotator.swg | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bindings/amplifier.swg b/bindings/amplifier.swg index a22a02765..d352cf3b4 100644 --- a/bindings/amplifier.swg +++ b/bindings/amplifier.swg @@ -148,6 +148,7 @@ typedef struct Amp { AMPMETHOD1GET(get_powerstat, powerstat_t) +#ifdef SWIGPYTHON PyObject * get_level(setting_t level) { value_t val; @@ -163,5 +164,5 @@ typedef struct Amp { return PyLong_FromLong(val.i); } - +#endif }; diff --git a/bindings/rotator.swg b/bindings/rotator.swg index 7cff51045..9aedbbd31 100644 --- a/bindings/rotator.swg +++ b/bindings/rotator.swg @@ -119,6 +119,7 @@ typedef struct Rot { ROTMETHOD2(set_conf, hamlib_token_t, const_char_string) +#ifdef SWIGPYTHON ROT_GET_LONG(func) ROT_GET_LONG(ext_func) @@ -127,6 +128,7 @@ typedef struct Rot { ROT_GET_VALUE_T(parm) ROT_GET_VALUE_T(ext_parm) +#endif const char *get_conf(hamlib_token_t tok) { static char s[128] = "";