summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Generic-SDCC-C.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-08-15 18:22:54 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-08-15 18:22:54 (GMT)
commit984b0adc5f41f5ddb9087ab99d1ffa901674f442 (patch)
tree8a0f5742c293d426505f437106f353a4c0eb1fbc /Modules/Platform/Generic-SDCC-C.cmake
parentf1115a30eecd4b6c9459c1526ec49b7a76394097 (diff)
downloadCMake-984b0adc5f41f5ddb9087ab99d1ffa901674f442.zip
CMake-984b0adc5f41f5ddb9087ab99d1ffa901674f442.tar.gz
CMake-984b0adc5f41f5ddb9087ab99d1ffa901674f442.tar.bz2
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
Diffstat (limited to 'Modules/Platform/Generic-SDCC-C.cmake')
-rw-r--r--Modules/Platform/Generic-SDCC-C.cmake11
1 files changed, 10 insertions, 1 deletions
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 "<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