llvm.org GIT mirror llvm / 1917aaf
[CMake][Lit][unittests] Deprecate CMAKE_BUILD_TYPE in each build directory for unittests. For example, cur) unittests/ADT/Release/ADTTests new) unittests/ADT/ADTTests RUNTIME_BUILD_MODE can be substituted to CMAKE_CFG_INTDIR. With Make and Ninja, the tree is not built with multiple configurations. Then, including the build type in target directory doesn't make sense. See also "How can I build multiple modes without switching?" http://www.cmake.org/Wiki/CMake_FAQ CMAKE_CFG_INTDIR is set to "." With multiple-configuration-aware build system, like Visual Studio, each unittest is built on appropriate directory, for example, unittests/ADT/Release/ADTTests.exe CMAKE_CFG_INTDIR is set to build system's variable, like "$(Configuration)" or "$(OutDir)". Thus, "--param build_config" is also deprecated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173616 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 6 years ago
3 changed file(s) with 5 addition(s) and 25 deletion(s). Raw diff Collapse all Expand all
156156
157157 # Returns directory where unittest should reside.
158158 function(get_unittest_directory dir)
159 if (CMAKE_BUILD_TYPE)
160 set(result ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
161 else()
162 set(result ${CMAKE_CURRENT_BINARY_DIR})
163 endif()
159 set(result ${CMAKE_CURRENT_BINARY_DIR})
164160 set(${dir} ${result} PARENT_SCOPE)
165161 endfunction()
166162
244240
245241 set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR})
246242 set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR})
247 set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
248 set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/%(build_config)s")
243 set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_mode)s")
244 set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/%(build_mode)s")
249245 set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
250246 set(ENABLE_SHARED ${LLVM_SHARED_LIBS_ENABLED})
251247 set(SHLIBPATH_VAR ${SHLIBPATH_VAR})
271267 set(LIT_COMMAND
272268 ${PYTHON_EXECUTABLE}
273269 ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py
274 --param build_config=${CMAKE_CFG_INTDIR}
275 --param build_mode=${RUNTIME_BUILD_MODE}
270 --param build_mode=${CMAKE_CFG_INTDIR}
276271 ${LIT_ARGS}
277272 )
278273 foreach(param ${ARG_PARAMS})
88 set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
99 elseif( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
1010 set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
11 endif()
12
13 # Run-time build mode; It is used for unittests.
14 if(MSVC_IDE)
15 # Expect "$(Configuration)", "$(OutDir)", etc.
16 # It is expanded by msbuild or similar.
17 set(RUNTIME_BUILD_MODE "${CMAKE_CFG_INTDIR}")
18 elseif(NOT CMAKE_BUILD_TYPE STREQUAL "")
19 # Expect "Release" "Debug", etc.
20 # Or unittests could not run.
21 set(RUNTIME_BUILD_MODE ${CMAKE_BUILD_TYPE})
22 else()
23 # It might be "."
24 set(RUNTIME_BUILD_MODE "${CMAKE_CFG_INTDIR}")
2511 endif()
2612
2713 if( LLVM_ENABLE_ASSERTIONS )
1212 # Set up some builtin parameters, so that by default the LLVM test suite
1313 # configuration file knows how to find the object tree.
1414 builtin_parameters = {
15 'build_config' : "@CMAKE_CFG_INTDIR@",
16 'build_mode' : "@RUNTIME_BUILD_MODE@",
15 'build_mode' : "@CMAKE_CFG_INTDIR@",
1716 'llvm_site_config' : os.path.join(llvm_obj_root, 'test', 'lit.site.cfg')
1817 }
1918