Skip to content

Commit

Permalink
[flang][examples] Add missing CMake dependencies
Browse files Browse the repository at this point in the history
Currently, everything that includes "flang/Parser/parse-tree.h" in Flang
depends on the `gen_acc` and `gen_omp` CMake targets (these targets
generate include files that are used in "parse-tree.h"). The examples in
Flang do use this header file and hence also depend on
`gen_acc`/`gen_omp`. This patch updates relevant CMake scripts
accordingly.

I've also taken the liberty to rename some of the example files so that
their names follow LLVM's coding guidelines.

Differential Revision: https://reviews.llvm.org/D117016
  • Loading branch information
banach-space committed Jan 24, 2022
1 parent 67346b4 commit 7ccacaf
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion flang/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ target_link_libraries(external-hello-world
)

add_subdirectory(PrintFlangFunctionNames)
add_subdirectory(flang-omp-report-plugin)
add_subdirectory(FlangOmpReport)
9 changes: 9 additions & 0 deletions flang/examples/FlangOmpReport/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_llvm_library(flangOmpReport
MODULE
FlangOmpReport.cpp
FlangOmpReportVisitor.cpp

DEPENDS
acc_gen
omp_gen
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//
//===----------------------------------------------------------------------===//

#include "flang-omp-report-visitor.h"
#include "FlangOmpReportVisitor.h"

#include "flang/Frontend/CompilerInstance.h"
#include "flang/Frontend/FrontendActions.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include "flang-omp-report-visitor.h"
#include "FlangOmpReportVisitor.h"
#include "llvm/ADT/StringExtras.h"

namespace Fortran {
Expand Down
7 changes: 5 additions & 2 deletions flang/examples/PrintFlangFunctionNames/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# TODO: Note that this is currently only available on Linux.
# On Windows, we would also have to specify e.g. `PLUGIN_TOOL`.
add_llvm_library(
flangPrintFunctionNames
add_llvm_library(flangPrintFunctionNames
MODULE
PrintFlangFunctionNames.cpp

DEPENDS
acc_gen
omp_gen
)
6 changes: 0 additions & 6 deletions flang/examples/flang-omp-report-plugin/CMakeLists.txt

This file was deleted.

0 comments on commit 7ccacaf

Please sign in to comment.