
Update the folder titles for targets in the monorepository that have not seen taken care of for some time. These are the folders that targets are organized in Visual Studio and XCode (`set_property(TARGET <target> PROPERTY FOLDER "<title>")`) when using the respective CMake's IDE generator. * Ensure that every target is in a folder * Use a folder hierarchy with each LLVM subproject as a top-level folder * Use consistent folder names between subprojects * When using target-creating functions from AddLLVM.cmake, automatically deduce the folder. This reduces the number of `set_property`/`set_target_property`, but are still necessary when `add_custom_target`, `add_executable`, `add_library`, etc. are used. A LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root CMakeLists.txt.
36 lines
1.2 KiB
CMake
36 lines
1.2 KiB
CMake
set(test_name CommandLineInitTests)
|
|
set(test_suite UnitTests)
|
|
|
|
# We don't call add_llvm_unittest() here, because the function automatically
|
|
# links the test against TestMain.cpp, in which main() function calls
|
|
# llvm::cl::ParseCommandLineOptions, and it makes the test always pass.
|
|
# The following code mainly comes from `add_unittest` in
|
|
# llvm/cmake/modules/AddLLVM.cmake, except that gtest_main is excluded from
|
|
# target_link_libraries to prevent the test linking against TestMain.cpp.
|
|
|
|
if (NOT LLVM_BUILD_TESTS)
|
|
set(EXCLUDE_FROM_ALL ON)
|
|
endif()
|
|
|
|
if (SUPPORTS_VARIADIC_MACROS_FLAG)
|
|
list(APPEND LLVM_COMPILE_FLAGS "-Wno-variadic-macros")
|
|
endif ()
|
|
# Some parts of gtest rely on this GNU extension, don't warn on it.
|
|
if(SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG)
|
|
list(APPEND LLVM_COMPILE_FLAGS "-Wno-gnu-zero-variadic-macro-arguments")
|
|
endif()
|
|
|
|
list(APPEND LLVM_LINK_COMPONENTS Support)
|
|
|
|
add_llvm_executable(${test_name}
|
|
IGNORE_EXTERNALIZE_DEBUGINFO NO_INSTALL_RPATH
|
|
CommandLineInitTest.cpp)
|
|
|
|
target_link_libraries(${test_name} PRIVATE llvm_gtest)
|
|
|
|
add_dependencies(${test_suite} ${test_name})
|
|
|
|
set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
|
|
set_output_directory(${test_name} BINARY_DIR ${outdir} LIBRARY_DIR ${outdir})
|
|
|