From f125a9aaf47758d56711b1592fffc8a75cffccc4 Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Thu, 23 May 2019 18:08:22 +0800 Subject: [PATCH 1/3] cmake: restore creation of kconfig_menus.json --- tools/ci/test_build_system_cmake.sh | 3 ++- tools/cmake/kconfig.cmake | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index 05bdb1b7ae..c4290fe1d4 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -58,6 +58,7 @@ function run_tests() BOOTLOADER_BINS="bootloader/bootloader.elf bootloader/bootloader.bin" APP_BINS="app-template.elf app-template.bin" PARTITION_BIN="partition_table/partition-table.bin" + BUILD_ARTIFACTS="project_description.json flasher_args.json config/kconfig_menus.json config/sdkconfig.json" IDF_COMPONENT_PREFIX="__idf" print_status "Initial clean build" @@ -65,7 +66,7 @@ function run_tests() idf.py build || exit $? # check all the expected build artifacts from the clean build - assert_built ${APP_BINS} ${BOOTLOADER_BINS} ${PARTITION_BIN} + assert_built ${APP_BINS} ${BOOTLOADER_BINS} ${PARTITION_BIN} ${BUILD_ARTIFACTS} print_status "Updating component source file rebuilds component" # touch a file & do a build diff --git a/tools/cmake/kconfig.cmake b/tools/cmake/kconfig.cmake index 6846ba6fdc..00d1aa904e 100644 --- a/tools/cmake/kconfig.cmake +++ b/tools/cmake/kconfig.cmake @@ -137,7 +137,7 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults) set(sdkconfig_cmake ${config_dir}/sdkconfig.cmake) set(sdkconfig_header ${config_dir}/sdkconfig.h) set(sdkconfig_json ${config_dir}/sdkconfig.json) - set(sdkconfig_json_menus ${config_dir}/${kconfig_menus}.json) + set(sdkconfig_json_menus ${config_dir}/kconfig_menus.json) idf_build_get_property(output_sdkconfig __OUTPUT_SDKCONFIG) if(output_sdkconfig) From 74c6c926ea142bf5cee1699b8269cbe639655530 Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Wed, 22 May 2019 11:36:03 +0800 Subject: [PATCH 2/3] nghttp: move HAVE_CONFIG_H compile definition to component --- components/nghttp/CMakeLists.txt | 2 ++ tools/cmake/build.cmake | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/nghttp/CMakeLists.txt b/components/nghttp/CMakeLists.txt index b1a4b16421..c1c4d80942 100644 --- a/components/nghttp/CMakeLists.txt +++ b/components/nghttp/CMakeLists.txt @@ -24,3 +24,5 @@ set(COMPONENT_SRCS "nghttp2/lib/nghttp2_buf.c" "port/http_parser.c") register_component() + +target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DHAVE_CONFIG_H") diff --git a/tools/cmake/build.cmake b/tools/cmake/build.cmake index 2371c94623..af335d3f1e 100644 --- a/tools/cmake/build.cmake +++ b/tools/cmake/build.cmake @@ -91,7 +91,7 @@ function(__build_set_default_build_specifications) unset(c_compile_options) unset(cxx_compile_options) - list(APPEND compile_definitions "-DHAVE_CONFIG_H" "-D_GNU_SOURCE") + list(APPEND compile_definitions "-D_GNU_SOURCE") list(APPEND compile_options "-ffunction-sections" "-fdata-sections" From 25b539d4fc6fd20fd442599420212c392cda0d59 Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Thu, 23 May 2019 18:20:43 +0800 Subject: [PATCH 3/3] cmake: make project includes know gcc version as well --- CMakeLists.txt | 9 --------- tools/cmake/build.cmake | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec96655dc2..8b38b6aa44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,15 +9,6 @@ unset(compile_definitions) # Add the following build specifications here, since these seem to be dependent # on config values on the root Kconfig. -# Temporary trick to support both gcc5 and gcc8 builds -if(CMAKE_C_COMPILER_VERSION VERSION_EQUAL 5.2.0) - set(GCC_NOT_5_2_0 0 CACHE STRING "GCC is 5.2.0 version") -else() - set(GCC_NOT_5_2_0 1 CACHE STRING "GCC is not 5.2.0 version") -endif() - -list(APPEND compile_definitions "-DGCC_NOT_5_2_0=${GCC_NOT_5_2_0}") - if(CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE) list(APPEND compile_options "-Os") else() diff --git a/tools/cmake/build.cmake b/tools/cmake/build.cmake index af335d3f1e..306486c165 100644 --- a/tools/cmake/build.cmake +++ b/tools/cmake/build.cmake @@ -442,6 +442,14 @@ macro(idf_build_process target) idf_build_set_property(___COMPONENT_REQUIRES_COMMON ${lib} APPEND) endforeach() + # Temporary trick to support both gcc5 and gcc8 builds + if(CMAKE_C_COMPILER_VERSION VERSION_EQUAL 5.2.0) + set(GCC_NOT_5_2_0 0 CACHE STRING "GCC is 5.2.0 version") + else() + set(GCC_NOT_5_2_0 1 CACHE STRING "GCC is not 5.2.0 version") + endif() + idf_build_set_property(COMPILE_DEFINITIONS "-DGCC_NOT_5_2_0" APPEND) + # All targets built under this scope is with the ESP-IDF build system set(ESP_PLATFORM 1) idf_build_set_property(COMPILE_DEFINITIONS "-DESP_PLATFORM" APPEND)