mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 07:30:43 +03:00
Locate Intrinsics.td in CMakeLists.txt.
The LLVM_INCLUDE_DIR is not always defined (e.g. missing in Windows). We simply locate the file and pass the folder path to the tool.
This commit is contained in:
parent
7674e4292f
commit
add8e91653
2 changed files with 12 additions and 3 deletions
|
@ -306,6 +306,16 @@ get_target_property(LDC_LOC ${LDC_EXE} LOCATION)
|
|||
#
|
||||
# Intrinsics module generation tools.
|
||||
#
|
||||
|
||||
# The LLVM_INCLUDE_DIR definition is not always set, e.g. on Windows.
|
||||
find_path(LLVM_INTRINSIC_TD_PATH "llvm/Intrinsics.td" PATHS ${LLVM_INCLUDE_DIRS} NO_DEFAULT_PATH)
|
||||
if (${LLVM_INTRINSIC_TD_PATH} STREQUAL "LLVM_INTRINSIC_TD_PATH-NOTFOUND")
|
||||
message(SEND_ERROR "File llvm/Intrinsics.td not found")
|
||||
else()
|
||||
message(STATUS "Using path for llvm/Intrinsics.td: ${LLVM_INTRINSIC_TD_PATH}")
|
||||
endif()
|
||||
add_definitions(-DLLVM_INTRINSIC_TD_PATH="${LLVM_INTRINSIC_TD_PATH}")
|
||||
|
||||
add_executable(gen_gccbuiltins utils/gen_gccbuiltins.cpp)
|
||||
|
||||
# Prior to LLVM 3.2, TableGen still uses RTTI, contrary to the rest of LLVM.
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <llvm/Config/llvm-config.h>
|
||||
#include <llvm/TableGen/Main.h>
|
||||
#if LDC_LLVM_VER < 302
|
||||
#include <llvm/TableGen/TableGenAction.h>
|
||||
|
@ -148,11 +147,11 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
sys::Path file(LLVM_INCLUDEDIR);
|
||||
sys::Path file(LLVM_INTRINSIC_TD_PATH);
|
||||
file.appendComponent("llvm");
|
||||
file.appendComponent("Intrinsics.td");
|
||||
|
||||
string iStr = string("-I=") + string(LLVM_INCLUDEDIR);
|
||||
string iStr = string("-I=") + string(LLVM_INTRINSIC_TD_PATH);
|
||||
string oStr = string("-o=") + argv[1];
|
||||
|
||||
vector<char*> args2(argv, argv + 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue