Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions flang-rt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Debug
Release
MinSizeRel
build
root
tags
TAGS
.nfs*
*.sw?
*~
*#
CMakeCache.txt
*/CMakeFiles/*
*/*/CMakeFiles/*
*/Makefile
*/*/Makefile
cmake_install.cmake
formatted
.DS_Store
.vs_code
13 changes: 10 additions & 3 deletions flang-rt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# included using the LLVM_ENABLE_RUNTIMES mechanism.
#
#===------------------------------------------------------------------------===#

cmake_minimum_required(VERSION 3.20.0)
if (NOT LLVM_RUNTIMES_BUILD)
message(FATAL_ERROR "Use this CMakeLists.txt from LLVM's runtimes build system.
Example:
Expand Down Expand Up @@ -54,13 +54,16 @@ if (CMAKE_VERSION VERSION_LESS "3.24")
set(CMAKE_Fortran_LINKER_WRAPPER_FLAG "-Wl,")
set(CMAKE_Fortran_LINKER_WRAPPER_FLAG_SEP ",")
endif ()
else ()
set(CMAKE_Fortran_COMPILER_FORCED ON)
endif ()
enable_language(Fortran)


list(APPEND CMAKE_MODULE_PATH
"${FLANG_RT_SOURCE_DIR}/cmake/modules"
"${FLANG_SOURCE_DIR}/cmake/modules"
"${FLANG_SOURCE_DIR}/../cmake/Modules"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

)
include(AddFlangRT)
include(GetToolchainDirs)
Expand Down Expand Up @@ -142,12 +145,14 @@ option(FLANG_RT_INCLUDE_TESTS "Generate build targets for the flang-rt unit and
# Provide an interface to link against the LLVM libc/libc++ projects directly.
set(FLANG_RT_SUPPORTED_PROVIDERS system llvm)
set(FLANG_RT_LIBC_PROVIDER "system" CACHE STRING "Specify C library to use. Supported values are ${FLANG_RT_SUPPORTED_PROVIDERS}.")
if (NOT "${FLANG_RT_LIBC_PROVIDER}" IN_LIST FLANG_RT_SUPPORTED_PROVIDERS)
list(FIND FLANG_RT_SUPPORTED_PROVIDERS "${FLANG_RT_LIBC_PROVIDER}" libc_index)
if (libc_index EQUAL -1)
message(FATAL_ERROR "Unsupported library: '${FLANG_RT_RUNTIME_PROVIDER}'. Supported values are ${FLANG_RT_SUPPORTED_PROVIDERS}.")
endif ()

set(FLANG_RT_LIBCXX_PROVIDER "system" CACHE STRING "Specify C++ library to use. Supported values are ${FLANG_RT_SUPPORTED_PROVIDERS}.")
if (NOT "${FLANG_RT_LIBCXX_PROVIDER}" IN_LIST FLANG_RT_SUPPORTED_PROVIDERS)
list(FIND FLANG_RT_SUPPORTED_PROVIDERS "${FLANG_RT_LIBCXX_PROVIDER}" libcxx_index)
if (libcxx_index EQUAL -1)
message(FATAL_ERROR "Unsupported library: '${FLANG_RT_LIBCXX_PROVIDER}'. Supported values are ${FLANG_RT_SUPPORTED_PROVIDERS}.")
endif ()

Expand Down Expand Up @@ -250,6 +255,8 @@ endif ()
# Aternatively, we could use
# CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU"
# but some older versions of CMake don't define it for GCC itself.
include(CheckCXXCompilerFlag)
include(CheckLinkerFlag)
check_cxx_compiler_flag("-Wp,-UTESTFLAG" FLANG_RT_SUPPORTS_UNDEFINE_FLAG)

# Check whether -fno-lto is supported.
Expand Down