[llvm] r196377 - [CMake] add_lit_target: Let lit.site.cfg free from "--param build_mode" on single configuration builds, like autoconf build.
NAKAMURA Takumi
geek4civic at gmail.com
Wed Dec 4 03:15:17 PST 2013
Author: chapuni
Date: Wed Dec 4 05:15:17 2013
New Revision: 196377
URL: http://llvm.org/viewvc/llvm-project?rev=196377&view=rev
Log:
[CMake] add_lit_target: Let lit.site.cfg free from "--param build_mode" on single configuration builds, like autoconf build.
Modified:
llvm/trunk/cmake/modules/AddLLVM.cmake
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=196377&r1=196376&r2=196377&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Wed Dec 4 05:15:17 2013
@@ -277,12 +277,16 @@ function(configure_lit_site_cfg input ou
endif()
# Configuration-time: See Unit/lit.site.cfg.in
- set(LLVM_BUILD_MODE "%(build_mode)s")
+ if (CMAKE_CFG_INTDIR STREQUAL ".")
+ set(LLVM_BUILD_MODE ".")
+ else ()
+ set(LLVM_BUILD_MODE "%(build_mode)s")
+ endif ()
set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR})
set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR})
- set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_mode)s")
- set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/%(build_mode)s")
+ set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/${LLVM_BUILD_MODE}")
+ set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/${LLVM_BUILD_MODE}")
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
set(ENABLE_SHARED ${LLVM_SHARED_LIBS_ENABLED})
set(SHLIBPATH_VAR ${SHLIBPATH_VAR})
@@ -321,10 +325,12 @@ function(add_lit_target target comment)
parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
set(LIT_ARGS "${ARG_ARGS} ${LLVM_LIT_ARGS}")
separate_arguments(LIT_ARGS)
+ if (NOT CMAKE_CFG_INTDIR STREQUAL ".")
+ list(APPEND LIT_ARGS --param build_mode=${CMAKE_CFG_INTDIR})
+ endif ()
set(LIT_COMMAND
${PYTHON_EXECUTABLE}
${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py
- --param build_mode=${CMAKE_CFG_INTDIR}
${LIT_ARGS}
)
foreach(param ${ARG_PARAMS})
More information about the llvm-commits
mailing list