Update requires in xmake.lua of README.md.
[liba.git] / cmake / UseTinyCC.cmake
blob912821e04cc954addc02bc26dad098e2c15412b9
1 set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
2 set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
3 set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> -ar qc <TARGET> <LINK_FLAGS> <OBJECTS>")
4 set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> -ar qc <TARGET> <LINK_FLAGS> <OBJECTS>")
5 set(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
6 set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG "-Wl,-rpath,")
7 set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ":")
8 set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O1")
9 set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-O1")
10 set(CMAKE_C_FLAGS_RELEASE_INIT "-O1")
11 find_program(CMAKE_C_COMPILER tcc)
12 find_program(CMAKE_AR tcc)
13 if(CMAKE_VERSION VERSION_LESS 3.10)
14   execute_process(COMMAND ${CMAKE_UNAME} -m OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET OUTPUT_VARIABLE OS_PLATFORM)
15   execute_process(COMMAND ${CMAKE_UNAME} -s OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET OUTPUT_VARIABLE OS_NAME)
16 else()
17   cmake_host_system_information(RESULT OS_PLATFORM QUERY OS_PLATFORM)
18   cmake_host_system_information(RESULT OS_NAME QUERY OS_NAME)
19 endif()
20 if(DEFINED ENV{ANDROID_ROOT} AND EXISTS $ENV{ANDROID_ROOT})
21   string(TOLOWER ${OS_PLATFORM}-${OS_NAME}-android CMAKE_LIBRARY_ARCHITECTURE)
22 elseif(UNIX)
23   string(TOLOWER ${OS_PLATFORM}-${OS_NAME}-gnu CMAKE_LIBRARY_ARCHITECTURE)
24 endif()
25 if(CMAKE_TOOLCHAIN_FILE)
26 endif()