CMake older than 3.20.0 is no longer supported.
This removes work-arounds for no longer supported versions.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/
D152102
add_dependencies(compiler-rt ${name})
endfunction()
-function(add_asm_sources output)
- set(${output} ${ARGN} PARENT_SCOPE)
- # CMake doesn't pass the correct architecture for Apple prior to CMake 3.19. https://gitlab.kitware.com/cmake/cmake/-/issues/20771
- # MinGW didn't work correctly with assembly prior to CMake 3.17. https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4287 and https://reviews.llvm.org/rGb780df052dd2b246a760d00e00f7de9ebdab9d09
- # Workaround these two issues by compiling as C.
- # Same workaround used in libunwind. Also update there if changed here.
- if((APPLE AND CMAKE_VERSION VERSION_LESS 3.19) OR (MINGW AND CMAKE_VERSION VERSION_LESS 3.17))
- set_source_files_properties(${ARGN} PROPERTIES LANGUAGE C)
- endif()
-endfunction()
-
macro(set_output_name output name arch)
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
set(${output} ${name})
# Add `-Wl,-G`. Quoted from release notes of cmake-3.16.0
# > On AIX, runtime linking is no longer enabled by default.
# See https://cmake.org/cmake/help/latest/release/3.16.html
- if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
- set(linkopts -Wl,-G ${linkopts})
- endif()
+ set(linkopts -Wl,-G ${linkopts})
set(${link_flags} ${linkopts} PARENT_SCOPE)
endfunction()
function(get_aix_libatomic_type type)
- if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
- set(${type} SHARED PARENT_SCOPE)
- else()
- set(${type} MODULE PARENT_SCOPE)
- endif()
+ set(${type} MODULE PARENT_SCOPE)
endfunction()
macro(archive_aix_libatomic name libname)
endif()
if (APPLE)
- add_asm_sources(ORC_ASM_SOURCES
+ set(ORC_ASM_SOURCES
macho_tlv.x86-64.S
macho_tlv.arm64.S
)
elfnix_platform.cpp
)
- add_asm_sources(ORC_ASM_SOURCES
+ set(ORC_ASM_SOURCES
elfnix_tls.x86-64.S
elfnix_tls.aarch64.S
)
message(FATAL_ERROR "Building the TSan runtime requires at least macOS SDK 10.12 (or aligned SDK on other platforms)")
endif()
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_amd64.S
tsan_rtl_aarch64.S
)
else()
foreach(arch ${TSAN_SUPPORTED_ARCH})
if(arch STREQUAL "x86_64")
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_amd64.S
)
# Check for Go runtime.
COMMENT "Checking TSan Go runtime..."
VERBATIM)
elseif(arch STREQUAL "aarch64")
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_aarch64.S
)
# Check for Go runtime.
COMMENT "Checking TSan Go runtime..."
VERBATIM)
elseif(arch MATCHES "powerpc64|powerpc64le")
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_ppc64.S
)
# Check for Go runtime.
COMMENT "Checking TSan Go runtime..."
VERBATIM)
elseif(arch MATCHES "loongarch64")
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_loongarch64.S
)
elseif(arch MATCHES "mips64|mips64le")
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_mips64.S
)
elseif(arch MATCHES "s390x")
- add_asm_sources(TSAN_ASM_SOURCES
+ set(TSAN_ASM_SOURCES
tsan_rtl_s390x.S
)
# Check for Go runtime.