Forráskód Böngészése

#3 C10添加webconfig

Signed-off-by: wlxuz <myxuan475@126.com>
Change-Id: I3f42374454c2c42542e805481c368135d6d42b16
wlxuz 11 hónapja
szülő
commit
66dc00b854
3 módosított fájl, 36 hozzáadás és 107 törlés
  1. 5 35
      C10/CMakeLists.txt
  2. 21 13
      C10/build.py
  3. 10 59
      C4/CMakeLists.txt

+ 5 - 35
C10/CMakeLists.txt

@@ -1,6 +1,6 @@
 
 #rights reserved
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.6)
 
 include(${ROOT_DIR}/buildtools/cmake/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.cmake)
 #project name
@@ -27,15 +27,10 @@ message(STATUS "PROJECT_SOURCE_DIR: ${PRODUCT_ROOT_DIR}, PROJECT_BINARY_DIR: ${P
 add_definitions(-DUSE_HTNICE)
 add_definitions(-DHTNICE_K4)
 # add_definitions(-DLINUX)
-# add_definitions(-D__arm__)
 
 set(BUILD_SHARED_LIBS OFF)
 set(EVENT_LIBRARY_TYPE STATIC)
 
-# link_directories(
-#     ${PROJECT_BINARY_DIR}/thirdparty/openssl/ssl
-# )
-
 include_directories(${PRODUCT_ROOT_DIR})
 
 build_subdirectory(thirdparty/openssl link thirdparty/openssl/ssl)
@@ -48,32 +43,7 @@ build_subdirectory(thirdparty/libxml2)
 build_subdirectory(thirdparty/SQLiteCpp include thirdparty/SQLiteCpp/sqlite3)
 
 build_subdirectory(utils)
-if (THIRDPARTY_LIBXML2)
-message("libxml2: ON")
-else()
-message("libxml2: OFF")
-endif()
-
-build_subdirectory(gw_leo)
-
-# build sx1302_hal
-# . ../../../../misc_config
-# LICHEE_TOOL=out/${MISC_CHIP}/linux/common/buildroot/host/opt/ext-toolchain/bin
-# export LICHEE_CHIP=${MISC_CHIP}
-# export FBDEV=${MISC_FBDEV}
-# export SDK_LIB=${MISC_SDKLIB}
-# export CEDARX_LIB=${MISC_CEDARXLIB}
-# export PATH=$PATH:$PWD/../../../../../$LICHEE_TOOL/
-# make
-# * `export ARCH=arm`
-# * `export CROSS_COMPILE=arm-linux-gnueabihf-`
-# set(ARCH "arm")
-# set(CROSS_COMPILE ${CMAKE_C_COMPILER})
-# execute_process(
-#     COMMAND ${MAKE} -j ${JOB_N} --directory=${PRODUCT_BUILD_DIR}/Lora/sx1302_hal
-#     WORKING_DIRECTORY ${PRODUCT_ROOT_DIR}/Lora/sx1302_hal
-#     OUTPUT_VARIABLE output
-#     ERROR_VARIABLE error
-#     )
-
-# message(STATUS "Output: ${output}, error: ${error}")
+
+build_subdirectory(foundation/gw_leo)
+
+build_subdirectory(foundation/webconfig)

+ 21 - 13
C10/build.py

@@ -6,8 +6,12 @@ import re
 import getpass
 import glob
 
-def build(build_utils, job_n, product_name, root_dir, bin_dir):
+def build(build_utils, job_n):
     # 设置环境变量
+
+    root_dir = os.environ['TOP_DIR']
+    bin_dir = os.environ['OUT_DIR']
+
     os.environ['ARCH'] = 'arm'
     os.environ['CROSS_COMPILE'] = f'{root_dir}/buildtools/toolchains/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-'
     os.environ["DESTDIR"] = f'{bin_dir}/Lora/sx1302_hal'
@@ -22,18 +26,22 @@ def build(build_utils, job_n, product_name, root_dir, bin_dir):
     subprocess.check_call(['make', f'--directory={root_dir}/Lora/sx1302_hal', f'--jobs={job_n}'])
 
 
-def build_install(build_utils, job_n, product_name, root_dir, bin_dir):
+def build_install(build_utils):
+    root_dir = os.environ['TOP_DIR']
+    bin_dir = os.environ['OUT_DIR']
+    install_dir = os.environ['INSTALL_DIR']
+    job_n = os.environ["JOBS_N"]
     # install test_loragw_*
-    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/libloragw/test_loragw_*', f'{bin_dir}/Lora/sx1302_hal/install/')
-    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/tools/reset_lgw.sh', f'{bin_dir}/Lora/sx1302_hal/install/', True)
+    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/libloragw/test_loragw_*', f'{install_dir}/Lora/sx1302_hal/')
+    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/tools/reset_lgw.sh', f'{install_dir}/Lora/sx1302_hal/', True)
 
     # install packet_forwarder
-    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/packet_forwarder/lora_pkt_fwd', f'{bin_dir}/Lora/sx1302_hal/install/')
-    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/packet_forwarder/global_conf.json.sx1250.*', f'{bin_dir}/Lora/sx1302_hal/install/', True)
-    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/packet_forwarder/global_config.json.sx1255.*', f'{bin_dir}/Lora/sx1302_hal/install/', True)
-    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/packet_forwarder/global_config.json.sx1257.*', f'{bin_dir}/Lora/sx1302_hal/install/', True)
-
-    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/util_boot/boot', f'{bin_dir}/Lora/sx1302_hal/install/')
-    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/util_chip_id/chip_id', f'{bin_dir}/Lora/sx1302_hal/install/')
-    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/util_net_downlink/net_downlink', f'{bin_dir}/Lora/sx1302_hal/install/')
-    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/util_spectral_scan/spectral_scan', f'{bin_dir}/Lora/sx1302_hal/install/')
+    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/packet_forwarder/lora_pkt_fwd', f'{install_dir}/Lora/sx1302_hal/')
+    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/packet_forwarder/global_conf.json.sx1250.*', f'{install_dir}/Lora/sx1302_hal/', True)
+    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/packet_forwarder/global_config.json.sx1255.*', f'{install_dir}/Lora/sx1302_hal/', True)
+    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/packet_forwarder/global_config.json.sx1257.*', f'{install_dir}/Lora/sx1302_hal/', True)
+
+    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/util_boot/boot', f'{install_dir}/Lora/sx1302_hal/')
+    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/util_chip_id/chip_id', f'{install_dir}/Lora/sx1302_hal/')
+    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/util_net_downlink/net_downlink', f'{install_dir}/Lora/sx1302_hal/')
+    build_utils.move_matching_files(f'{root_dir}/Lora/sx1302_hal/util_spectral_scan/spectral_scan', f'{install_dir}/Lora/sx1302_hal/')

+ 10 - 59
C4/CMakeLists.txt

@@ -2,6 +2,7 @@
 #rights reserved
 cmake_minimum_required(VERSION 2.8)
 
+include(${ROOT_DIR}/buildtools/cmake/gcc-gt675x-10.4.0-2023.06.27-x86_64_aarch64-htnice-linux-gnu.cmake)
 #project name
 set(PROJECT_NAME "leo-das")
 
@@ -9,20 +10,6 @@ message(INFO " SYSTEM_ARCH:${SYSTEM_ARCH}\n")
 set(CMAKE_BUILD_TYPE RELEASE)
 set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x")
 
-macro(get_git_branch _git_branch)
-    find_package(Git QUIET)
-    if(GIT_FOUND)
-      execute_process(
-        COMMAND ${GIT_EXECUTABLE} symbolic-ref -q HEAD
-        OUTPUT_VARIABLE ${_git_branch}
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-        ERROR_QUIET
-        WORKING_DIRECTORY
-          ${CMAKE_CURRENT_SOURCE_DIR}
-        )
-    endif()
-endmacro()
-
 # 获取当前的分支
 set(GIT_BRANCH "")
 get_git_branch(GIT_BRANCH)
@@ -31,7 +18,6 @@ message(STATUS "Git branch is ${_git_branch}")                     # 宏的结
 
 add_definitions(-DDAS_VERSION=\"${_git_branch}\")
 
-include(${ROOT_DIR}/buildtools/cmake/gcc-gt675x-10.4.0-2023.06.27-x86_64_aarch64-htnice-linux-gnu.cmake)
 project(${PROJECT_NAME})
 
 set(PROJECT_SOURCE_DIR ${ROOT_DIR})
@@ -48,55 +34,20 @@ add_definitions(-DHTNICE_K4)
 # add_definitions(-DLINUX)
 # add_definitions(-D__arm__)
 
-
-
-link_directories(${PROJECT_BINARY_DIR}/thirdparty/Libevent/lib
-    ${PROJECT_BINARY_DIR}/thirdparty/zlib
-    ${PROJECT_BINARY_DIR}/thirdparty/json-c
-    ${PROJECT_BINARY_DIR}/thirdparty/libxml2
-    ${PROJECT_BINARY_DIR}/thirdparty/SQLiteCpp/sqlite3
-)
-include_directories(
-    ${PROJECT_BINARY_DIR}/thirdparty/libxml2
-    ${PROJECT_BINARY_DIR}/thirdparty/zlib
-    ${PROJECT_BINARY_DIR}/thirdparty/openssl/include
-    ${PROJECT_BINARY_DIR}/thirdparty/libevent/include
-)
-
-#
-
-include_directories(
-    ${PROJECT_SOURCE_DIR}/thirdparty/zlib
-    ${PROJECT_SOURCE_DIR}/thirdparty/openssl/include
-    ${PROJECT_SOURCE_DIR}/thirdparty/libxml2/include
-    ${PROJECT_SOURCE_DIR}/thirdparty/mbedtls/include
-    ${PROJECT_SOURCE_DIR}/thirdparty/SQLiteCpp/sqlite3
-    ${PROJECT_SOURCE_DIR}/thirdparty/libevent/include
-    ${PROJECT_SOURCE_DIR}/
-)
 set(BUILD_SHARED_LIBS OFF)
 set(EVENT_LIBRARY_TYPE STATIC)
 
-add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/openssl ${PROJECT_BINARY_DIR}/thirdparty/openssl)
-add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/mbedtls ${PROJECT_BINARY_DIR}/thirdparty/mbedtls)
-add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/zlib ${PROJECT_BINARY_DIR}/thirdparty/zlib)
-
-set(LIBXML2_WITH_PYTHON OFF)
-add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/libxml2 ${PROJECT_BINARY_DIR}/thirdparty/libxml2)
+include_directories(${PRODUCT_ROOT_DIR})
 
-add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/SQLiteCpp ${PROJECT_BINARY_DIR}/thirdparty/SQLiteCpp)
+build_subdirectory(thirdparty/openssl link thirdparty/openssl/ssl)
+build_subdirectory(thirdparty/mbedtls)
+build_subdirectory(thirdparty/zlib)
 
-add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/libevent ${PROJECT_BINARY_DIR}/thirdparty/libevent)
-
-add_subdirectory(${PROJECT_SOURCE_DIR}/utils ${PROJECT_BINARY_DIR}/utils)
+set(LIBXML2_WITH_PYTHON OFF)
+build_subdirectory(thirdparty/libxml2)
 
+build_subdirectory(thirdparty/SQLiteCpp include thirdparty/SQLiteCpp/sqlite3)
 
-# set(MbedTLS_DIR ${ROOT_DIR}/thirdparty/mbedtls/cmake)
-# find_package(MbedTLS REQUIRED CONFIG)
-# message("MbedTLS: ${MbedTLS_FOUND}, ${MbedTLS_INCLUDE_DIRS}, ${MbedTLS_LIBS}")
-# if(MbedTLS_FOUND)
-#     link_libraries(${MbedTLS_LIBS})
-#     include_directories(${MbedTLS_INCLUDE_DIRS})
-# endif()
+build_subdirectory(utils)
 
-add_subdirectory(${PROJECT_SOURCE_DIR}/gw_leo ${PROJECT_BINARY_DIR}/gw_leo)
+build_subdirectory(foundation/gw_leo)