You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

49 lines
1.6 KiB

include(find_compiler)
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR c6416)
c6x_find_compiler(C6X_COMPILER_CC cl6x.exe)
c6x_find_compiler(C6X_HEX6X hex6x.exe)
# Specify the cross compiler.
set(CMAKE_C_COMPILER ${C6X_COMPILER_CC} CACHE FILEPATH "C compiler")
set(CMAKE_CXX_COMPILER ${C6X_COMPILER_CC} CACHE FILEPATH "C++ compiler")
# todo should we be including CMakeASMInformation anyway - i guess that is host side
set(CMAKE_ASM_COMPILER ${C6X_COMPILER_CC} CACHE FILEPATH "ASM compiler")
# Look for includes and libraries only in the target system prefix.
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
if (NOT DEFINED C64X_ABI)
set(C64X_ABI "coffabi")
endif()
# Get the C6X_C_DIR
get_filename_component(CL6X_DIR "${C6X_COMPILER_CC}" DIRECTORY)
string(REPLACE "bin" "include" C6X_C_DIR "${CL6X_DIR}")
string(REPLACE "bin" "lib" C6X_CLIB_DIR "${CL6X_DIR}")
set(C6X_C_DIR ${C6X_C_DIR} CACHE PATH "Path to Compiler include path" FORCE)
set(ENV{C6X_C_DIR} "${C6X_C_DIR}")
# on DSP flags
set(C6X_COMMON_FLAGS "--define=CHIP_6416 --define=c6416 --abi=${C64X_ABI} --include_path=${C6X_C_DIR} --relaxed_ansi -mv6400")
foreach(LANG IN ITEMS C CXX ASM)
set(CMAKE_${LANG}_FLAGS_INIT "${C6X_COMMON_FLAGS}")
if (CSL_DEOPTIMIZED_DEBUG)
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-O2")
else()
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-g")
endif()
set(CMAKE_${LANG}_LINK_FLAGS "--rom_model --search_path=${C6X_CLIB_DIR}")
endforeach()