[flang-commits] [flang] 76e7c8f - [flang] Revise IDE folder structure (#89745)
via flang-commits
flang-commits at lists.llvm.org
Sat May 25 08:25:01 PDT 2024
Author: Michael Kruse
Date: 2024-05-25T17:24:58+02:00
New Revision: 76e7c8f4aaa7f3bdf6085927756a8772ab7f00f6
URL: https://github.com/llvm/llvm-project/commit/76e7c8f4aaa7f3bdf6085927756a8772ab7f00f6
DIFF: https://github.com/llvm/llvm-project/commit/76e7c8f4aaa7f3bdf6085927756a8772ab7f00f6.diff
LOG: [flang] Revise IDE folder structure (#89745)
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.
Added:
Modified:
flang/CMakeLists.txt
flang/cmake/modules/AddFlang.cmake
flang/docs/CMakeLists.txt
flang/include/flang/Optimizer/Dialect/CMakeLists.txt
flang/runtime/CMakeLists.txt
flang/test/CMakeLists.txt
flang/tools/f18/CMakeLists.txt
flang/unittests/CMakeLists.txt
flang/unittests/Evaluate/CMakeLists.txt
Removed:
################################################################################
diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
index af34366b36526..cbe8f1186236a 100644
--- a/flang/CMakeLists.txt
+++ b/flang/CMakeLists.txt
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.20.0)
+set(LLVM_SUBPROJECT_TITLE "Flang")
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -481,7 +482,7 @@ endif()
# Custom target to install Flang libraries.
add_custom_target(flang-libraries)
-set_target_properties(flang-libraries PROPERTIES FOLDER "Misc")
+set_target_properties(flang-libraries PROPERTIES FOLDER "Flang/Meta")
if (NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(install-flang-libraries
diff --git a/flang/cmake/modules/AddFlang.cmake b/flang/cmake/modules/AddFlang.cmake
index 41ce8738e7bf2..3a5119b83831f 100644
--- a/flang/cmake/modules/AddFlang.cmake
+++ b/flang/cmake/modules/AddFlang.cmake
@@ -94,13 +94,12 @@ function(add_flang_library name)
add_custom_target(${name})
endif()
- set_target_properties(${name} PROPERTIES FOLDER "Flang libraries")
+ set_target_properties(${name} PROPERTIES FOLDER "Flang/Libraries")
set_flang_windows_version_resource_properties(${name})
endfunction(add_flang_library)
macro(add_flang_executable name)
add_llvm_executable(${name} ${ARGN})
- set_target_properties(${name} PROPERTIES FOLDER "Flang executables")
set_flang_windows_version_resource_properties(${name})
endmacro(add_flang_executable)
diff --git a/flang/docs/CMakeLists.txt b/flang/docs/CMakeLists.txt
index 3414b8e3acc46..3e4883e881ffa 100644
--- a/flang/docs/CMakeLists.txt
+++ b/flang/docs/CMakeLists.txt
@@ -79,7 +79,7 @@ if (LLVM_ENABLE_DOXYGEN)
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating flang doxygen documentation." VERBATIM)
-
+ set_target_properties(doxygen-flang PROPERTIES FOLDER "Flang/Docs")
if (LLVM_BUILD_DOCS)
add_dependencies(doxygen doxygen-flang)
endif()
diff --git a/flang/include/flang/Optimizer/Dialect/CMakeLists.txt b/flang/include/flang/Optimizer/Dialect/CMakeLists.txt
index 301a93c1fe5b4..10ab213b30b02 100644
--- a/flang/include/flang/Optimizer/Dialect/CMakeLists.txt
+++ b/flang/include/flang/Optimizer/Dialect/CMakeLists.txt
@@ -33,6 +33,7 @@ mlir_tablegen(CanonicalizationPatterns.inc -gen-rewriters)
add_public_tablegen_target(CanonicalizationPatternsIncGen)
add_custom_target(flang-doc)
+set_target_properties(flang-doc PROPERTIES FOLDER "Flang/Docs")
set(dialect_doc_filename "FIRLangRef")
set(LLVM_TARGET_DEFINITIONS FIROps.td)
@@ -45,4 +46,5 @@ add_custom_command(
${GEN_DOC_FILE}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${dialect_doc_filename}.md)
add_custom_target(${dialect_doc_filename}DocGen DEPENDS ${GEN_DOC_FILE})
+set_target_properties(${dialect_doc_filename}DocGen PROPERTIES FOLDER "Flang/Tablegenning/Docs")
add_dependencies(flang-doc ${dialect_doc_filename}DocGen)
diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt
index 4c2afd0abe903..a826980e19411 100644
--- a/flang/runtime/CMakeLists.txt
+++ b/flang/runtime/CMakeLists.txt
@@ -271,21 +271,26 @@ else()
LINK_LIBS
FortranDecimal.static
INSTALL_WITH_TOOLCHAIN)
+ set_target_properties(FortranRuntime.static PROPERTIES FOLDER "Flang/Runtime Libraries")
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
add_flang_library(FortranRuntime.dynamic ${sources}
LINK_LIBS
FortranDecimal.dynamic
INSTALL_WITH_TOOLCHAIN)
+ set_target_properties(FortranRuntime.dynamic PROPERTIES FOLDER "Flang/Runtime Libraries")
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDebug)
add_flang_library(FortranRuntime.static_dbg ${sources}
LINK_LIBS
FortranDecimal.static_dbg
INSTALL_WITH_TOOLCHAIN)
+ set_target_properties(FortranRuntime.static_dbg PROPERTIES FOLDER "Flang/Runtime Libraries")
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDebugDLL)
add_flang_library(FortranRuntime.dynamic_dbg ${sources}
LINK_LIBS
FortranDecimal.dynamic_dbg
INSTALL_WITH_TOOLCHAIN)
+ set_target_properties(FortranRuntime.dynamic_dbg PROPERTIES FOLDER "Flang/Runtime Libraries")
add_dependencies(FortranRuntime FortranRuntime.static FortranRuntime.dynamic
FortranRuntime.static_dbg FortranRuntime.dynamic_dbg)
endif()
+set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries")
diff --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt
index 7e036ad539dfc..43ad1e3312b64 100644
--- a/flang/test/CMakeLists.txt
+++ b/flang/test/CMakeLists.txt
@@ -83,13 +83,14 @@ if (LLVM_BUILD_EXAMPLES)
endif ()
add_custom_target(flang-test-depends DEPENDS ${FLANG_TEST_DEPENDS})
+set_target_properties(flang-test-depends PROPERTIES FOLDER "Flang/Meta")
add_lit_testsuite(check-flang "Running the Flang regression tests"
${CMAKE_CURRENT_BINARY_DIR}
PARAMS ${FLANG_TEST_PARAMS}
DEPENDS ${FLANG_TEST_DEPENDS}
)
-set_target_properties(check-flang PROPERTIES FOLDER "Tests")
+set_target_properties(check-flang PROPERTIES FOLDER "Flang/Meta")
# In case of standalone builds.
if (FLANG_STANDALONE_BUILD)
diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt
index 35e1cdafd3ae3..4771199651602 100644
--- a/flang/tools/f18/CMakeLists.txt
+++ b/flang/tools/f18/CMakeLists.txt
@@ -96,6 +96,7 @@ if (NOT CMAKE_CROSSCOMPILING)
endif()
add_custom_target(module_files ALL DEPENDS ${MODULE_FILES})
+set_target_properties(module_files PROPERTIES FOLDER "Flang/Resources")
# TODO Move this to a more suitable location
# Copy the generated omp_lib.h header file, if OpenMP support has been configured.
diff --git a/flang/unittests/CMakeLists.txt b/flang/unittests/CMakeLists.txt
index 72d37ebeb853c..945067fed4f82 100644
--- a/flang/unittests/CMakeLists.txt
+++ b/flang/unittests/CMakeLists.txt
@@ -8,7 +8,7 @@ if (FLANG_EXPERIMENTAL_CUDA_RUNTIME)
endif()
add_custom_target(FlangUnitTests)
-set_target_properties(FlangUnitTests PROPERTIES FOLDER "Flang Unit Tests")
+set_target_properties(FlangUnitTests PROPERTIES FOLDER "Flang/Tests")
function(add_flang_unittest_offload_properties target)
# Set CUDA_RESOLVE_DEVICE_SYMBOLS.
@@ -55,6 +55,7 @@ function(add_flang_nongtest_unittest test_name)
endif()
add_executable(${test_name}${suffix} ${test_name}.cpp)
+ set_target_properties(${test_name}${suffix} PROPERTIES FOLDER "Flang/Tests/Unit")
if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB)
set(llvm_libs LLVM)
diff --git a/flang/unittests/Evaluate/CMakeLists.txt b/flang/unittests/Evaluate/CMakeLists.txt
index 4658d8d3345b5..52eb385f4763f 100644
--- a/flang/unittests/Evaluate/CMakeLists.txt
+++ b/flang/unittests/Evaluate/CMakeLists.txt
@@ -3,6 +3,7 @@ add_library(FortranEvaluateTesting
testing.cpp
fp-testing.cpp
)
+set_target_properties(FortranEvaluateTesting PROPERTIES FOLDER "Flang/Tests")
if (LLVM_LINK_LLVM_DYLIB)
set(llvm_libs LLVM)
else()
More information about the flang-commits
mailing list