Changeset View
Changeset View
Standalone View
Standalone View
cmake/Modules/AddCompilerRT.cmake
Show All 13 Lines | |||||
function(add_compiler_rt_object_libraries name) | function(add_compiler_rt_object_libraries name) | ||||
cmake_parse_arguments(LIB "" "" "OS;ARCHS;SOURCES;CFLAGS;DEFS" ${ARGN}) | cmake_parse_arguments(LIB "" "" "OS;ARCHS;SOURCES;CFLAGS;DEFS" ${ARGN}) | ||||
set(libnames) | set(libnames) | ||||
if(APPLE) | if(APPLE) | ||||
foreach(os ${LIB_OS}) | foreach(os ${LIB_OS}) | ||||
set(libname "${name}.${os}") | set(libname "${name}.${os}") | ||||
set(libnames ${libnames} ${libname}) | set(libnames ${libnames} ${libname}) | ||||
set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS}) | set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS}) | ||||
list_union(LIB_ARCHS_${libname} DARWIN_${os}_ARCHS LIB_ARCHS) | list_intersect(LIB_ARCHS_${libname} DARWIN_${os}_ARCHS LIB_ARCHS) | ||||
endforeach() | endforeach() | ||||
else() | else() | ||||
foreach(arch ${LIB_ARCHS}) | foreach(arch ${LIB_ARCHS}) | ||||
set(libname "${name}.${arch}") | set(libname "${name}.${arch}") | ||||
set(libnames ${libnames} ${libname}) | set(libnames ${libnames} ${libname}) | ||||
set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS}) | set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS}) | ||||
if(NOT CAN_TARGET_${arch}) | if(NOT CAN_TARGET_${arch}) | ||||
message(FATAL_ERROR "Architecture ${arch} can't be targeted") | message(FATAL_ERROR "Architecture ${arch} can't be targeted") | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | function(add_compiler_rt_runtime name type) | ||||
if(APPLE) | if(APPLE) | ||||
foreach(os ${LIB_OS}) | foreach(os ${LIB_OS}) | ||||
if(type STREQUAL "STATIC") | if(type STREQUAL "STATIC") | ||||
set(libname "${name}_${os}") | set(libname "${name}_${os}") | ||||
else() | else() | ||||
set(libname "${name}_${os}_dynamic") | set(libname "${name}_${os}_dynamic") | ||||
set(extra_linkflags_${libname} ${DARWIN_${os}_LINKFLAGS} ${LIB_LINKFLAGS}) | set(extra_linkflags_${libname} ${DARWIN_${os}_LINKFLAGS} ${LIB_LINKFLAGS}) | ||||
endif() | endif() | ||||
list_union(LIB_ARCHS_${libname} DARWIN_${os}_ARCHS LIB_ARCHS) | list_intersect(LIB_ARCHS_${libname} DARWIN_${os}_ARCHS LIB_ARCHS) | ||||
if(LIB_ARCHS_${libname}) | if(LIB_ARCHS_${libname}) | ||||
list(APPEND libnames ${libname}) | list(APPEND libnames ${libname}) | ||||
set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS} ${LIB_CFLAGS}) | set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS} ${LIB_CFLAGS}) | ||||
set(output_name_${libname} ${libname}${COMPILER_RT_OS_SUFFIX}) | set(output_name_${libname} ${libname}${COMPILER_RT_OS_SUFFIX}) | ||||
set(sources_${libname} ${LIB_SOURCES}) | set(sources_${libname} ${LIB_SOURCES}) | ||||
format_object_libs(sources_${libname} ${os} ${LIB_OBJECT_LIBS}) | format_object_libs(sources_${libname} ${os} ${LIB_OBJECT_LIBS}) | ||||
endif() | endif() | ||||
endforeach() | endforeach() | ||||
▲ Show 20 Lines • Show All 242 Lines • Show Last 20 Lines |