diff --git a/cmake/dts.cmake b/cmake/dts.cmake index 15a86f9ee49..eb7382207b0 100644 --- a/cmake/dts.cmake +++ b/cmake/dts.cmake @@ -159,6 +159,7 @@ if(SUPPORTS_DTS) # themselves, so we don't rely on the C compiler otherwise. # + if(DTC) set(DTC_WARN_UNIT_ADDR_IF_ENABLED "") check_dtc_flag("-Wunique_unit_address_if_enabled" check) if (check) @@ -186,6 +187,7 @@ if(SUPPORTS_DTS) if(NOT "${ret}" STREQUAL "0") message(FATAL_ERROR "command failed with return code: ${ret}") endif() + endif(DTC) # # Run gen_defines.py to create a .conf file and a header file diff --git a/cmake/host-tools.cmake b/cmake/host-tools.cmake index 050bb90e2b9..6858f2f3f82 100644 --- a/cmake/host-tools.cmake +++ b/cmake/host-tools.cmake @@ -47,7 +47,7 @@ else() endif() endif() -# Search for the must-have program dtc on PATH and in +# dtc is an optional dependency. Search for it on PATH and in # TOOLCHAIN_HOME. Usually DTC will be provided by an SDK, but for # SDK-less projects like gnuarmemb, it is up to the user to install # dtc. @@ -55,10 +55,8 @@ find_program( DTC dtc ) -if(${DTC} STREQUAL DTC-NOTFOUND) - message(FATAL_ERROR "Unable to find dtc") -endif() +if(DTC) # Parse the 'dtc --version' and make sure it is at least MIN_DTC_VERSION set(MIN_DTC_VERSION 1.4.6) execute_process( @@ -75,6 +73,7 @@ if(${CMAKE_MATCH_1} VERSION_LESS ${MIN_DTC_VERSION}) for how to use the SDK's dtc alongside a custom toolchain." ) endif() +endif(DTC) find_program( GPERF