From 1f49d725abf458070db063b81dd7093a00835274 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 2 Dec 2011 10:08:15 -0500 Subject: [PATCH 1/3] Recognize the Tiny C Compiler (#12605) See compiler home page here: http://tinycc.org/ http://bellard.org/tcc/ Use the id "TinyCC" as it appears in their online documentation. --- Modules/CMakeCCompilerId.c.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index c91553a95..4cc690a26 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -48,6 +48,9 @@ #elif defined(__TI_COMPILER_VERSION__) # define COMPILER_ID "TI_DSP" +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + #elif defined(__SCO_VERSION__) # define COMPILER_ID "SCO" From ec636e299ff1b74457dc4fa306cbd9f33fabce9e Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 2 Dec 2011 10:22:44 -0500 Subject: [PATCH 2/3] TinyCC: Add compiler info for shared libs on Linux (#12605) Use the "-shared" option to link shared libraries. The compiler does not support "-Wl," or "-rpath" but does know how to pass "-soname" through to the linker. --- Modules/Compiler/TinyCC-C.cmake | 1 + Modules/Platform/Linux-TinyCC-C.cmake | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 Modules/Compiler/TinyCC-C.cmake create mode 100644 Modules/Platform/Linux-TinyCC-C.cmake diff --git a/Modules/Compiler/TinyCC-C.cmake b/Modules/Compiler/TinyCC-C.cmake new file mode 100644 index 000000000..bb27eadde --- /dev/null +++ b/Modules/Compiler/TinyCC-C.cmake @@ -0,0 +1 @@ +SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") diff --git a/Modules/Platform/Linux-TinyCC-C.cmake b/Modules/Platform/Linux-TinyCC-C.cmake new file mode 100644 index 000000000..b753268ea --- /dev/null +++ b/Modules/Platform/Linux-TinyCC-C.cmake @@ -0,0 +1,4 @@ +SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") +SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") +SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "") +SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-soname ") From 0efe602c595e78c5e7cef6c85dc7983be7a905df Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Sat, 3 Dec 2011 12:21:48 +0100 Subject: [PATCH 3/3] TinyCC: Add default compilation flags (#12605) --- Modules/Compiler/TinyCC-C.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Modules/Compiler/TinyCC-C.cmake b/Modules/Compiler/TinyCC-C.cmake index bb27eadde..4a48c0af5 100644 --- a/Modules/Compiler/TinyCC-C.cmake +++ b/Modules/Compiler/TinyCC-C.cmake @@ -1 +1,8 @@ SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") + +# no optimization in tcc: +SET (CMAKE_C_FLAGS_INIT "") +SET (CMAKE_C_FLAGS_DEBUG_INIT "-g") +SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG") +SET (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG") +SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g")