# Copyright (C) 2014-2015 ARM Limited. All rights reserved. 

# can't test the compiler because it cross-compiles
set(CMAKE_CXX_COMPILER_WORKS TRUE)

set(EXPLICIT_INCLUDES "")
if((CMAKE_VERSION VERSION_GREATER "3.4.0") OR (CMAKE_VERSION VERSION_EQUAL "3.4.0"))
    # from CMake 3.4 <INCLUDES> are separate to <FLAGS> in the
    # CMAKE_<LANG>_COMPILE_OBJECT, CMAKE_<LANG>_CREATE_ASSEMBLY_SOURCE, and
    # CMAKE_<LANG>_CREATE_PREPROCESSED_SOURCE commands
    set(EXPLICIT_INCLUDES "<INCLUDES> ")
endif()

set(CMAKE_CXX_CREATE_SHARED_LIBRARY "echo 'shared libraries not supported' && 1")
set(CMAKE_CXX_CREATE_SHARED_MODULE  "echo 'shared modules not supported' && 1")
set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> -cr<LINK_FLAGS> <TARGET> <OBJECTS>")
set(CMAKE_CXX_COMPILE_OBJECT        "${ARMCC_ENV}<CMAKE_CXX_COMPILER> ${YOTTA_TARGET_DEFINITIONS} <DEFINES> -c ${EXPLICIT_INCLUDES}<FLAGS> -o <OBJECT> <SOURCE>")
set(CMAKE_CXX_LINK_EXECUTABLE       "<CMAKE_LINKER> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS>")

set(CMAKE_CXX_FLAGS_DEBUG_INIT          "-O0 -g")
set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT     "-O3 -Ospace -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE_INIT        "-O3 -Ospace -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O3 -Ospace -g -DNDEBUG")
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")

set(CMAKE_CXX_LINK_FLAGS "")

set(CMAKE_CXX_OUTPUT_EXTENSION ".o")
set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "--via=")
