cmake: Use find_program on CMAKE_CXX_COMPILER

'find_program' should be used instead of 'set' for determining the
paths of host programs. It resolves #9582 and various other issues.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2018-08-23 11:50:26 +02:00 committed by Anas Nashif
commit 1d90bcdc75

View file

@ -49,7 +49,7 @@ else()
set(cplusplus_compiler ${CMAKE_C_COMPILER})
endif()
endif()
set(CMAKE_CXX_COMPILER ${cplusplus_compiler} CACHE INTERNAL " " FORCE)
find_program(CMAKE_CXX_COMPILER ${cplusplus_compiler} PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
set(NOSTDINC "")