forked from ldc-developers/ldc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding FindMLIR.cmake to link mlir header to ldc and creating output_…
…mlir into globals.d
- Loading branch information
1 parent
a611de4
commit d739ef4
Showing
4 changed files
with
48 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # - Try to find MLIR project at LLVM | ||
| # | ||
| # The following are set after configuration is done: | ||
| # MLIR_FOUND | ||
| # MLIR_ROOT_DIRS | ||
| # MLIR_INCLUDE_DIRS | ||
| # MLIR_BUILD_INCLUDE_DIR | ||
| project(ldc) | ||
|
|
||
| find_path(MLIR_ROOT_DIR NAMES "CONTRIBUTING.md" HINTS ${LLVM_ROOT_DIR}/../projects/mlir) | ||
|
|
||
| #Used to get the main header files | ||
| find_path(MLIR_INCLUDE_DIR NAMES "Parser.h" HINTS ${LLVM_ROOT_DIR}/../projects/mlir/include/mlir) | ||
|
|
||
| #Used to get StandardOps.h.inc | ||
| find_path(MLIR_BUILD_INCLUDE_DIR NAMES "cmake_install.cmake" | ||
| HINTS ${LLVM_ROOT_DIR}/projects/mlir/include/mlir) | ||
|
|
||
| message("-- MLIR Dir: ${MLIR_ROOT_DIR}") | ||
| message("-- MLIR Include Dir: ${MLIR_INCLUDE_DIR}/..") | ||
| message("-- MLIR Build include dir: ${MLIR_BUILD_INCLUDE_DIR}/..") | ||
| message("flag") | ||
|
|
||
| set(MLIR_ROOT_DIRS ${MLIR_ROOT_DIR}) | ||
| set(MLIR_INCLUDE_DIRS ${MLIR_INCLUDE_DIR}/..) | ||
| set(MLIR_BUILD_INCLUDE_DIRS ${MLIR_BUILD_INCLUDE_DIR}/..) | ||
|
|
||
| # Handle the QUIETLY and REQUIRED arguments and set the MLIR_FOUND to TRUE | ||
| # if all listed variables are TRUE | ||
| include(FindPackageHandleStandardArgs) | ||
|
|
||
| find_package_handle_standard_args(MLIR DEFAULT_MSG MLIR_ROOT_DIRS MLIR_INCLUDE_DIRS | ||
| MLIR_BUILD_INCLUDE_DIRS) | ||
|
|
||
| mark_as_advanced(MLIR_ROOT_DIRS MLIR_INCLUDE_DIRS MLIR_BUILD_INCLUDE_DIRS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters