Skip to content

Commit

Permalink
Correctly pass down list of variants to enable
Browse files Browse the repository at this point in the history
CMake automatically expands a string containing semi-colons to a
list, but ExternalProject argument must also be a semi-colon
separated list. To get around this, convert the string to a comma
separated list, since the LIST_SEPARATOR option will reinterpret
this as a semi-colon list.
  • Loading branch information
dcandler committed Nov 19, 2024
1 parent 28fd984 commit 6b98d48
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,12 @@ if(NOT PREBUILT_TARGET_LIBRARIES)
endif()
endif()

# ENABLE_VARIANTS expects a semi-colon separated list.
# To prevent CMake expanding it automatically while passing it
# down, switch to comma separated. Enabling the ExternalProject
# LIST_SEPARATOR option will handle switching it back.
string(REPLACE ";" "," ENABLE_VARIANTS_PASSTHROUGH "${LLVM_TOOLCHAIN_LIBRARY_VARIANTS}")

ExternalProject_Add(
multilib-${LLVM_TOOLCHAIN_C_LIBRARY}
PREFIX ${CMAKE_BINARY_DIR}/multilib-builds
Expand All @@ -583,7 +589,7 @@ if(NOT PREBUILT_TARGET_LIBRARIES)
-DC_LIBRARY=${LLVM_TOOLCHAIN_C_LIBRARY}
-DLLVM_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/llvm
-DMULTILIB_JSON=${LLVM_TOOLCHAIN_MULTILIB_JSON}
-DENABLE_VARIANTS=${LLVM_TOOLCHAIN_LIBRARY_VARIANTS}
-DENABLE_VARIANTS=${ENABLE_VARIANTS_PASSTHROUGH}
-DLIBC_HDRGEN=${LIBC_HDRGEN}
-DFVP_INSTALL_DIR=${FVP_INSTALL_DIR}
-DFVP_CONFIG_DIR=${CMAKE_CURRENT_SOURCE_DIR}/fvp/config
Expand Down

0 comments on commit 6b98d48

Please sign in to comment.