mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-11-03 22:08:28 +00:00 
			
		
		
		
	In components/xtensa/project_include.cmake ${CMAKE_C_COMPILER} -dumpmachine
is called, but the output has newline.
Before
---8<--
-- Compiler supported targets: xtensa-esp32s3-elf
-- App "blink" version: 1.2.3
---8<--
After
---8<--
-- Compiler supported targets: xtensa-esp32s3-elf
-- App "blink" version: 1.2.3
---8<--
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			839 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			839 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
# Check toolchain is configured properly in cmake
 | 
						|
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
 | 
						|
    # without '--target' option 'clang -dumpmachine' prints default target arch and it might be not Xtensa
 | 
						|
    # so use `-print-targets` option
 | 
						|
    execute_process(
 | 
						|
        COMMAND ${CMAKE_C_COMPILER} -print-targets
 | 
						|
        OUTPUT_VARIABLE dump_machine
 | 
						|
    )
 | 
						|
else()
 | 
						|
    execute_process(
 | 
						|
        COMMAND ${CMAKE_C_COMPILER} -dumpmachine
 | 
						|
        OUTPUT_VARIABLE dump_machine
 | 
						|
        OUTPUT_STRIP_TRAILING_WHITESPACE
 | 
						|
    )
 | 
						|
endif()
 | 
						|
message(STATUS "Compiler supported targets: ${dump_machine}")
 | 
						|
 | 
						|
if(NOT (${CMAKE_SYSTEM_NAME} STREQUAL "Generic" AND ${dump_machine} MATCHES xtensa))
 | 
						|
    message(FATAL_ERROR "Internal error, toolchain has not been set correctly by project "
 | 
						|
        "(or an invalid CMakeCache.txt file has been generated somehow)")
 | 
						|
endif()
 |