Skip to content

Commit 035afc6

Browse files
committed
use ARG_EXTRA_ARGS
1 parent 193d23d commit 035afc6

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

llvm/runtimes/CMakeLists.txt

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ function(builtin_register_target compiler_rt_path name)
137137
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON
138138
-DLLVM_CMAKE_DIR=${CMAKE_BINARY_DIR}
139139
-DCMAKE_C_COMPILER_WORKS=ON
140-
-DCMAKE_Fortran_COMPILER_WORKS=ON
141140
-DCMAKE_ASM_COMPILER_WORKS=ON
142141
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
143142
${COMMON_CMAKE_ARGS}
@@ -232,7 +231,7 @@ foreach(entry ${runtimes})
232231
endforeach()
233232

234233
function(runtime_default_target)
235-
cmake_parse_arguments(ARG "" "" "DEPENDS;CMAKE_ARGS;PREFIXES" ${ARGN})
234+
cmake_parse_arguments(ARG "" "" "DEPENDS;CMAKE_ARGS;PREFIXES;EXTRA_ARGS" ${ARGN})
236235

237236
include(${LLVM_BINARY_DIR}/runtimes/Components.cmake OPTIONAL)
238237
set(SUB_CHECK_TARGETS ${SUB_CHECK_TARGETS} PARENT_SCOPE)
@@ -263,7 +262,6 @@ function(runtime_default_target)
263262
llvm_ExternalProject_Add(runtimes
264263
${CMAKE_CURRENT_SOURCE_DIR}/../../runtimes
265264
DEPENDS ${ARG_DEPENDS}
266-
${enable_fortran}
267265
# Builtins were built separately above
268266
CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
269267
-DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
@@ -291,7 +289,7 @@ function(runtime_default_target)
291289
USE_TOOLCHAIN
292290
TARGET_TRIPLE ${LLVM_TARGET_TRIPLE}
293291
FOLDER "Runtimes"
294-
${EXTRA_ARGS})
292+
${EXTRA_ARGS} ${ARG_EXTRA_ARGS})
295293
endfunction()
296294

297295
# runtime_register_target(name)
@@ -401,7 +399,6 @@ function(runtime_register_target name)
401399
llvm_ExternalProject_Add(runtimes-${name}
402400
${CMAKE_CURRENT_SOURCE_DIR}/../../runtimes
403401
DEPENDS ${ARG_DEPENDS}
404-
${enable_fortran}
405402
# Builtins were built separately above
406403
CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=OFF
407404
-DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
@@ -469,7 +466,7 @@ if(build_runtimes)
469466
# together in a single CMake invocation.
470467
set(extra_deps "")
471468
set(extra_cmake_args "")
472-
set(enable_fortran "")
469+
set(extra_args "")
473470

474471
if(LLVM_INCLUDE_TESTS)
475472
foreach(dep FileCheck
@@ -574,21 +571,23 @@ if(build_runtimes)
574571
list(APPEND extra_cmake_args "-DLLVM_LIBC_FULL_BUILD=ON")
575572
endif()
576573
if("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
577-
set(enable_fortran ENABLE_FORTRAN)
574+
list(APPEND extra_args ENABLE_FORTRAN)
578575
endif ()
579576

580577
if(NOT LLVM_RUNTIME_TARGETS)
581578
runtime_default_target(
582579
DEPENDS ${builtins_dep} ${extra_deps}
583580
CMAKE_ARGS ${extra_cmake_args}
584-
PREFIXES ${prefixes})
581+
PREFIXES ${prefixes}
582+
EXTRA_ARGS ${extra_args})
585583
set(test_targets check-runtimes)
586584
else()
587585
if("default" IN_LIST LLVM_RUNTIME_TARGETS)
588586
runtime_default_target(
589587
DEPENDS ${builtins_dep} ${extra_deps}
590588
CMAKE_ARGS ${extra_cmake_args}
591-
PREFIXES ${prefixes})
589+
PREFIXES ${prefixes}
590+
EXTRA_ARGS ${extra_args})
592591
list(REMOVE_ITEM LLVM_RUNTIME_TARGETS "default")
593592
else()
594593
add_custom_target(runtimes)
@@ -635,7 +634,7 @@ if(build_runtimes)
635634
runtime_register_target(${name}
636635
DEPENDS ${builtins_dep_name} ${extra_deps}
637636
CMAKE_ARGS -DLLVM_DEFAULT_TARGET_TRIPLE=${name} ${extra_cmake_args}
638-
EXTRA_ARGS TARGET_TRIPLE ${name})
637+
EXTRA_ARGS TARGET_TRIPLE ${name} ${extra_args})
639638
endforeach()
640639

641640
foreach(multilib ${LLVM_RUNTIME_MULTILIBS})
@@ -646,7 +645,7 @@ if(build_runtimes)
646645
-DLLVM_RUNTIMES_PREFIX=${name}/
647646
-DLLVM_RUNTIMES_LIBDIR_SUBDIR=${multilib}
648647
BASE_NAME ${name}
649-
EXTRA_ARGS TARGET_TRIPLE ${name})
648+
EXTRA_ARGS TARGET_TRIPLE ${name} ${extra_args})
650649
endforeach()
651650
endforeach()
652651
endif()

0 commit comments

Comments
 (0)