From 9cb2fc7e45c5a686b935f05fcc564ff7d08a4ecf Mon Sep 17 00:00:00 2001 From: jiangwenyu1 Date: Wed, 26 Jul 2023 20:31:39 +0800 Subject: [PATCH] install header files when build with -i --- build/builder/commands/build.py | 15 +++++++++++++++ install_header_files.txt | 10 ++++++++++ 2 files changed, 25 insertions(+) create mode 100644 install_header_files.txt diff --git a/build/builder/commands/build.py b/build/builder/commands/build.py index 9c08ef9..374fd31 100755 --- a/build/builder/commands/build.py +++ b/build/builder/commands/build.py @@ -71,6 +71,21 @@ class Builder: rst = exec_sys_command(['sudo', 'cp', '-f', os.path.join(self.build_output_dir, 'common/common/', output_file), os.path.join(self.args.install, 'bin')]) if rst[0] == False : return False + # Install header files + install_header_files_dir = '/usr/include/ftengine/' + exec_sys_command(['sudo', 'mkdir', '-p', install_header_files_dir]) + install_header_files = open(os.path.join(self.project_dir, "install_header_files.txt")) + headers = install_header_files.readlines() + for header in headers: + if header.strip().startswith("#"): continue + header = header.rstrip('').rstrip('\n') + lit = header.split() + if len(lit) == 2 : + rst = exec_sys_command(['sudo', 'mkdir', '-p', install_header_files_dir + lit[1]]) + if rst[0] == False : return False + rst = exec_sys_command(['sudo', 'cp', '-rf', lit[0], install_header_files_dir + lit[1]]) + if rst[0] == False : return False + return True def launch_gn(self) -> bool: diff --git a/install_header_files.txt b/install_header_files.txt new file mode 100644 index 0000000..2493954 --- /dev/null +++ b/install_header_files.txt @@ -0,0 +1,10 @@ +#Instructions: 2 parameters are required to install the header file to /usr/include/ft_engine/ +# Param1: relative path of header file +# Param2: installation directory name (if this directory does not exist, +# it will be automatically created in /usr/include/ft_engine) +#Example: install test/test1.h to /usr/include/ft_engine/test_h, add: test/test1.h test_h + +window_manager/interfaces/innerkits/wm/window.h wm +window_manager/interfaces/innerkits/wm/window_option.h wm +window_manager/interfaces/innerkits/wm/wm_common.h wm +window_manager/interfaces/innerkits/dm/dm_common.h dm \ No newline at end of file -- Gitee