Mercurial > projects > ldc
comparison CMakeLists.txt @ 1520:1a93c3da09ef
Yet another fix for finding llvm's config file.
Since llvm-config --includedir sometimes includes the trailing llvm/ and
sometimes it doesn't, we just check both directories.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 30 Jun 2009 22:07:50 +0200 |
parents | 6182ceeb336a |
children | 6766485fb584 |
comparison
equal
deleted
inserted
replaced
1519:6182ceeb336a | 1520:1a93c3da09ef |
---|---|
141 OUTPUT_STRIP_TRAILING_WHITESPACE | 141 OUTPUT_STRIP_TRAILING_WHITESPACE |
142 ) | 142 ) |
143 | 143 |
144 # build a define that contains all LLVM targets required and is usable for | 144 # build a define that contains all LLVM targets required and is usable for |
145 # preprocessor code generation. start with the native target. | 145 # preprocessor code generation. start with the native target. |
146 file(STRINGS ${LLVM_INCLUDEDIR}/llvm/Config/config.h LLVM_NATIVE_ARCH REGEX "^#define LLVM_NATIVE_ARCH") | 146 find_path(LLVM_CONFIG_FILE_PATH config.h PATHS ${LLVM_INCLUDEDIR}/llvm/Config ${LLVM_INCLUDEDIR}/Config NO_DEFAULT_PATH) |
147 message(${LLVM_CONFIG_FILE_PATH}/config.h) | |
148 file(STRINGS ${LLVM_CONFIG_FILE_PATH}/config.h LLVM_NATIVE_ARCH REGEX "^#define LLVM_NATIVE_ARCH") | |
147 string(REGEX REPLACE "^#define LLVM_NATIVE_ARCH (.*)Target$" "\\1" LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}) | 149 string(REGEX REPLACE "^#define LLVM_NATIVE_ARCH (.*)Target$" "\\1" LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}) |
148 set(LLVM_MODULES_DEFINE "LLVM_TARGET(${LLVM_NATIVE_ARCH})") | 150 set(LLVM_MODULES_DEFINE "LLVM_TARGET(${LLVM_NATIVE_ARCH})") |
149 # chain the extra target list to the define | 151 # chain the extra target list to the define |
150 foreach(EXTRA_TARGET ${EXTRA_LLVM_MODULES}) | 152 foreach(EXTRA_TARGET ${EXTRA_LLVM_MODULES}) |
151 set(LLVM_MODULES_DEFINE "${LLVM_MODULES_DEFINE} LLVM_TARGET(${EXTRA_TARGET})") | 153 set(LLVM_MODULES_DEFINE "${LLVM_MODULES_DEFINE} LLVM_TARGET(${EXTRA_TARGET})") |