From: Angus Gratton Date: Wed, 21 Aug 2019 08:18:47 +0000 (+0800) Subject: Merge branch 'feature/freebsd_build_system' into 'master' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a3bad6119d97c931de9d6ab388f236b89575e8e;p=esp-idf Merge branch 'feature/freebsd_build_system' into 'master' build systems: Changes to work on FreeBSD Closes IDFGH-1657 See merge request espressif/esp-idf!5821 --- 5a3bad6119d97c931de9d6ab388f236b89575e8e diff --cc tools/cmake/kconfig.cmake index 4c9c4891bf,66b78e2576..6b808deb59 --- a/tools/cmake/kconfig.cmake +++ b/tools/cmake/kconfig.cmake @@@ -30,30 -30,15 +30,35 @@@ function(__kconfig_init "on the PATH, or an MSYS2 version of gcc on the PATH to build mconf-idf. " "Consult the setup docs for ESP-IDF on Windows.") endif() - elseif(WINPTY) - set(MCONF "\"${WINPTY}\" \"${MCONF}\"") + else() + execute_process(COMMAND "${MCONF}" -v + RESULT_VARIABLE mconf_res + OUTPUT_VARIABLE mconf_out + ERROR_VARIABLE mconf_err) + if(${mconf_res}) + message(WARNING "Failed to detect version of mconf-idf. Return code was ${mconf_res}.") + else() + string(STRIP "${mconf_out}" mconf_out) + set(mconf_expected_ver "mconf-v4.6.0.0-idf-20190628-win32") + if(NOT ${mconf_out} STREQUAL "mconf-idf version ${mconf_expected_ver}") + message(WARNING "Unexpected ${mconf_out}. Expected ${mconf_expected_ver}. " + "Please check the ESP-IDF Getting Started guide for version " + "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}.${IDF_VERSION_PATCH} " + "to correct this issue") + else() + message(STATUS "${mconf_out}") # prints: mconf-idf version .... + endif() + endif() + if(WINPTY) + set(MCONF "\"${WINPTY}\" \"${MCONF}\"") + endif() endif() endif() + if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "FreeBSD") + set(MAKE_COMMMAND "gmake") + else() + set(MAKE_COMMMAND "make") + endif() if(NOT MCONF) # Use the existing Makefile to build mconf (out of tree) when needed @@@ -67,9 -52,9 +72,9 @@@ externalproject_add(mconf-idf SOURCE_DIR ${src_path} CONFIGURE_COMMAND "" - BINARY_DIR "kconfig_bin" + BINARY_DIR "${CMAKE_BINARY_DIR}/kconfig_bin" BUILD_COMMAND rm -f ${src_path}/zconf.lex.c ${src_path}/zconf.hash.c - COMMAND make -f ${src_path}/Makefile mconf-idf + COMMAND ${MAKE_COMMMAND} -f ${src_path}/Makefile mconf-idf BUILD_BYPRODUCTS ${MCONF} INSTALL_COMMAND "" EXCLUDE_FROM_ALL 1