zephyr/cmake/compiler/host-gcc.cmake
Anas Nashif 622ab2f6fd toolchain: organise toolchain/compiler files
Move toolchain definitions into toolchain/ and move compilers to
compilers/
Usage of toolchain- for everything was confusing, there are the actual
compiler related definitions and there is the toolchain/SDK related
configs, so keeping them separate helps understand the different and
prevents confusion.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-13 07:44:45 -08:00

29 lines
1.1 KiB
CMake

# Configures CMake for using GCC
set(CMAKE_C_COMPILER gcc CACHE INTERNAL " " FORCE)
set(CMAKE_OBJCOPY objcopy CACHE INTERNAL " " FORCE)
set(CMAKE_OBJDUMP objdump CACHE INTERNAL " " FORCE)
#set(CMAKE_LINKER ld CACHE INTERNAL " " FORCE) # Not in use yet
set(CMAKE_AR ar CACHE INTERNAL " " FORCE)
set(CMAKE_RANLILB ranlib CACHE INTERNAL " " FORCE)
set(CMAKE_READELF readelf CACHE INTERNAL " " FORCE)
set(CMAKE_GDB gdb CACHE INTERNAL " " FORCE)
set(CMAKE_C_FLAGS -m32 CACHE INTERNAL " " FORCE)
set(CMAKE_CXX_FLAGS -m32 CACHE INTERNAL " " FORCE)
set(CMAKE_SHARED_LINKER_FLAGS -m32 CACHE INTERNAL " " FORCE)
if(CONFIG_CPLUSPLUS)
set(cplusplus_compiler g++)
else()
if(EXISTS g++)
set(cplusplus_compiler g++)
else()
# When the toolchain doesn't support C++, and we aren't building
# with C++ support just set it to something so CMake doesn't
# crash, it won't actually be called
set(cplusplus_compiler ${CMAKE_C_COMPILER})
endif()
endif()
set(CMAKE_CXX_COMPILER ${cplusplus_compiler} CACHE INTERNAL " " FORCE)