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
This commit is contained in:
parent
f1115a30ee
commit
984b0adc5f
|
@ -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 "<CMAKE_C_COMPILER> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||
|
||||
# link object files to an executable
|
||||
SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <OBJECTS> -o <TARGET> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
|
||||
SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <OBJECTS> --out-fmt-ihx -o <TARGET> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
|
||||
|
||||
# needs sdcc 2.7.0 + sddclib from cvs
|
||||
SET(CMAKE_C_CREATE_STATIC_LIBRARY
|
||||
|
|
Loading…
Reference in New Issue