From 984b0adc5f41f5ddb9087ab99d1ffa901674f442 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Wed, 15 Aug 2007 14:22:54 -0400 Subject: STYLE: explicitely set default options for sdcc, so it is visible for which processor it currently compiles, use --out-fmt-ihx to enforce .ihx files Alex --- Modules/Platform/Generic-SDCC-C.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake index 91b5de7..9e3f939 100644 --- a/Modules/Platform/Generic-SDCC-C.cmake +++ b/Modules/Platform/Generic-SDCC-C.cmake @@ -28,11 +28,20 @@ FIND_PROGRAM(SDCCLIB_EXECUTABLE sdcclib PATHS "${SDCC_LOCATION}" NO_DEFAULT_PATH FIND_PROGRAM(SDCCLIB_EXECUTABLE sdcclib) SET(CMAKE_AR "${SDCCLIB_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE) +# CMAKE_C_FLAGS_INIT and CMAKE_EXE_LINKER_FLAGS_INIT should be set in a CMAKE_SYSTEM_PROCESSOR file +IF(NOT DEFINED CMAKE_C_FLAGS_INIT) + SET(CMAKE_C_FLAGS_INIT -mmcs51 --model-small) +ENDIF(NOT DEFINED CMAKE_C_FLAGS_INIT) + +IF(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT) + SET (CMAKE_EXE_LINKER_FLAGS_INIT --model-small) +ENDIF(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT) + # compile a C file into an object file SET(CMAKE_C_COMPILE_OBJECT " -o -c ") # link object files to an executable -SET(CMAKE_C_LINK_EXECUTABLE " -o ") +SET(CMAKE_C_LINK_EXECUTABLE " --out-fmt-ihx -o ") # needs sdcc 2.7.0 + sddclib from cvs SET(CMAKE_C_CREATE_STATIC_LIBRARY -- cgit v0.12