1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-15 12:25:12 +03:00

Build handling

This commit is contained in:
3djc 2020-08-12 11:03:10 +02:00
parent 7e2d3fad35
commit 0acb935e85
3 changed files with 10 additions and 3 deletions

View file

@ -54,6 +54,7 @@ option(MODULE_PROTOCOL_FLEX "Add support for non certified FLEX modules" OFF)
option(MODULE_PROTOCOL_D8 "Add support for D8 modules" ON) option(MODULE_PROTOCOL_D8 "Add support for D8 modules" ON)
option(FRSKY_RELEASE "Used to build FrSky released firmware" OFF) option(FRSKY_RELEASE "Used to build FrSky released firmware" OFF)
option(TBS_RELEASE "Used to build TBS released firmware" OFF) option(TBS_RELEASE "Used to build TBS released firmware" OFF)
option(IMRC_RELEASE "Used to build IMRC released firmware" OFF)
option(ALLOW_TRAINER_MULTI "Allow multi trainer" OFF) option(ALLOW_TRAINER_MULTI "Allow multi trainer" OFF)
# since we reset all default CMAKE compiler flags for firmware builds, provide an alternate way for user to specify additional flags. # since we reset all default CMAKE compiler flags for firmware builds, provide an alternate way for user to specify additional flags.
@ -344,6 +345,10 @@ if(TBS_RELEASE)
add_definitions(-DTBS_RELEASE) add_definitions(-DTBS_RELEASE)
endif() endif()
if(IMRC_RELEASE)
add_definitions(-DIMRC_RELEASE)
endif()
if(FRSKY_RELEASE) if(FRSKY_RELEASE)
add_definitions(-DFRSKY_RELEASE) add_definitions(-DFRSKY_RELEASE)
set(POPUP_LEVEL 3) set(POPUP_LEVEL 3)

View file

@ -38,6 +38,8 @@
#define DISPLAY_VERSION "JumperRC" #define DISPLAY_VERSION "JumperRC"
#elif defined(TBS_RELEASE) #elif defined(TBS_RELEASE)
#define DISPLAY_VERSION "TBS" #define DISPLAY_VERSION "TBS"
#elif defined(IMRC_RELEASE)
#define DISPLAY_VERSION "IMRC"
#else #else
#define DISPLAY_VERSION VERSION #define DISPLAY_VERSION VERSION
#endif #endif

View file

@ -88,7 +88,7 @@ def build(board, translation, srcdir):
os.mkdir("output") os.mkdir("output")
path = tempfile.mkdtemp() path = tempfile.mkdtemp()
os.chdir(path) os.chdir(path)
command = "cmake %s -DTRANSLATIONS=%s -DTBS_RELEASE=YES -DTEST_BUILD_WARNING=YES %s" % (cmake_options, translation, srcdir) command = "cmake %s -DTRANSLATIONS=%s -DIMRC_RELEASE=YES -DTEST_BUILD_WARNING=YES %s" % (cmake_options, translation, srcdir)
print(command) print(command)
os.system(command) os.system(command)
os.system("make firmware -j16") os.system("make firmware -j16")
@ -96,7 +96,7 @@ def build(board, translation, srcdir):
index = 0 index = 0
while 1: while 1:
suffix = "" if index == 0 else "_%d" % index suffix = "" if index == 0 else "_%d" % index
filename = "output/tbs_firm_%s_%s_%s%s.bin" % (board.lower(), translation.lower(), timestamp(), suffix) filename = "output/ghost_firm_%s_%s_%s%s.bin" % (board.lower(), translation.lower(), timestamp(), suffix)
if not os.path.exists(filename): if not os.path.exists(filename):
shutil.copy("%s/firmware.bin" % path, filename) shutil.copy("%s/firmware.bin" % path, filename)
break break
@ -112,7 +112,7 @@ def dir_path(string):
def main(): def main():
parser = argparse.ArgumentParser(description="Build TBS firmware") parser = argparse.ArgumentParser(description="Build Ghost firmware")
parser.add_argument("-b", "--boards", action="append", help="Destination boards", required=True) parser.add_argument("-b", "--boards", action="append", help="Destination boards", required=True)
parser.add_argument("-t", "--translations", action="append", help="Translations", required=True) parser.add_argument("-t", "--translations", action="append", help="Translations", required=True)
parser.add_argument("srcdir", type=dir_path) parser.add_argument("srcdir", type=dir_path)