From e1f8a414e7b323c41a2ac88cc03cd25ad5e66319 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 25 Feb 2024 20:09:01 +1100 Subject: [PATCH] waf: remove SKETCH and SKETCHNAME from build sysmte ... renaming one of them to AP_BUILD_TARGET --- Tools/ardupilotwaf/ap_library.py | 2 +- Tools/ardupilotwaf/ardupilotwaf.py | 6 ++---- libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp | 2 +- libraries/AP_HAL_ChibiOS/Storage.cpp | 4 ++-- libraries/AP_HAL_Linux/Storage.cpp | 2 +- libraries/AP_HAL_SITL/SITL_cmdline.cpp | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Tools/ardupilotwaf/ap_library.py b/Tools/ardupilotwaf/ap_library.py index b49010ae06001..67cb61428248b 100644 --- a/Tools/ardupilotwaf/ap_library.py +++ b/Tools/ardupilotwaf/ap_library.py @@ -52,7 +52,7 @@ def _vehicle_index(vehicle): return _vehicle_indexes[vehicle] # note that AP_NavEKF3_core.h is needed for AP_NavEKF3_feature.h -_vehicle_macros = ['SKETCHNAME', 'SKETCH', 'APM_BUILD_DIRECTORY', +_vehicle_macros = ['APM_BUILD_DIRECTORY', 'AP_BUILD_TARGET_NAME', 'APM_BUILD_TYPE', 'APM_BUILD_COPTER_OR_HELI', 'AP_NavEKF3_core.h', 'lua_generated_bindings.h'] _macros_re = re.compile(r'\b(%s)\b' % '|'.join(_vehicle_macros)) diff --git a/Tools/ardupilotwaf/ardupilotwaf.py b/Tools/ardupilotwaf/ardupilotwaf.py index 882e2f86ca408..490fc21d9e287 100644 --- a/Tools/ardupilotwaf/ardupilotwaf.py +++ b/Tools/ardupilotwaf/ardupilotwaf.py @@ -125,14 +125,12 @@ def get_legacy_defines(sketch_name, bld): if bld.cmd == 'heli' or 'heli' in bld.targets: return [ 'APM_BUILD_DIRECTORY=APM_BUILD_Heli', - 'SKETCH="' + sketch_name + '"', - 'SKETCHNAME="' + sketch_name + '"', + 'AP_BUILD_TARGET_NAME="' + sketch_name + '"', ] return [ 'APM_BUILD_DIRECTORY=APM_BUILD_' + sketch_name, - 'SKETCH="' + sketch_name + '"', - 'SKETCHNAME="' + sketch_name + '"', + 'AP_BUILD_TARGET_NAME="' + sketch_name + '"', ] IGNORED_AP_LIBRARIES = [ diff --git a/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp b/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp index eb741e1ae7c52..ea55e7140f08a 100644 --- a/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp +++ b/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp @@ -286,7 +286,7 @@ static void main_loop() hal.scheduler->set_system_initialized(); thread_running = true; - chRegSetThreadName(SKETCHNAME); + chRegSetThreadName(AP_BUILD_TARGET_NAME); /* switch to high priority for main loop diff --git a/libraries/AP_HAL_ChibiOS/Storage.cpp b/libraries/AP_HAL_ChibiOS/Storage.cpp index e4ee42cc4ddb4..7f8fc2819b9c8 100644 --- a/libraries/AP_HAL_ChibiOS/Storage.cpp +++ b/libraries/AP_HAL_ChibiOS/Storage.cpp @@ -31,9 +31,9 @@ using namespace ChibiOS; extern const AP_HAL::HAL& hal; #ifndef HAL_STORAGE_FILE -// using SKETCHNAME allows the one microSD to be used +// using AP_BUILD_TARGET_NAME allows the one microSD to be used // for multiple vehicle types -#define HAL_STORAGE_FILE "/APM/" SKETCHNAME ".stg" +#define HAL_STORAGE_FILE "/APM/" AP_BUILD_TARGET_NAME ".stg" #endif #ifndef HAL_STORAGE_BACKUP_FOLDER diff --git a/libraries/AP_HAL_Linux/Storage.cpp b/libraries/AP_HAL_Linux/Storage.cpp index 4f9fc133a274a..4fc401c76405b 100644 --- a/libraries/AP_HAL_Linux/Storage.cpp +++ b/libraries/AP_HAL_Linux/Storage.cpp @@ -20,7 +20,7 @@ using namespace Linux; // name the storage file after the sketch so you can use the same board // card for ArduCopter and ArduPlane -#define STORAGE_FILE SKETCHNAME ".stg" +#define STORAGE_FILE AP_BUILD_TARGET_NAME ".stg" extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_HAL_SITL/SITL_cmdline.cpp b/libraries/AP_HAL_SITL/SITL_cmdline.cpp index 96ec46d879d99..f4c5529197ff4 100644 --- a/libraries/AP_HAL_SITL/SITL_cmdline.cpp +++ b/libraries/AP_HAL_SITL/SITL_cmdline.cpp @@ -212,7 +212,7 @@ void SITL_State::_parse_command_line(int argc, char * const argv[]) // default to CMAC const char *home_str = nullptr; const char *model_str = nullptr; - const char *vehicle_str = SKETCH; + const char *vehicle_str = AP_BUILD_TARGET_NAME; _use_fg_view = false; char *autotest_dir = nullptr; _fg_address = "127.0.0.1";