Alex Denisov | b677706 | 2016-04-16 06:47:41 +0000 | [diff] [blame] | 1 | @LIT_SITE_CFG_IN_HEADER@ |
| 2 | |
Daniel Dunbar | 4229b95 | 2013-08-07 23:09:10 +0000 | [diff] [blame] | 3 | import sys |
| 4 | |
Tim Northover | d66ad6c | 2013-05-04 07:36:23 +0000 | [diff] [blame] | 5 | config.host_triple = "@LLVM_HOST_TRIPLE@" |
Chandler Carruth | 96f41a1 | 2012-06-28 00:16:51 +0000 | [diff] [blame] | 6 | config.target_triple = "@TARGET_TRIPLE@" |
Daniel Dunbar | fb76ffb | 2009-09-22 07:38:33 +0000 | [diff] [blame] | 7 | config.llvm_src_root = "@LLVM_SOURCE_DIR@" |
| 8 | config.llvm_obj_root = "@LLVM_BINARY_DIR@" |
| 9 | config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" |
Peter Zotov | 91bf887 | 2014-12-30 03:24:11 +0000 | [diff] [blame] | 10 | config.llvm_lib_dir = "@LLVM_LIBRARY_DIR@" |
Chandler Carruth | 96f41a1 | 2012-06-28 00:16:51 +0000 | [diff] [blame] | 11 | config.llvm_shlib_dir = "@SHLIBDIR@" |
| 12 | config.llvm_shlib_ext = "@SHLIBEXT@" |
Alp Toker | 1214e71 | 2014-01-22 21:52:35 +0000 | [diff] [blame] | 13 | config.llvm_exe_ext = "@EXEEXT@" |
Andrew Trick | c86f24c | 2011-06-16 21:48:57 +0000 | [diff] [blame] | 14 | config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" |
Daniel Dunbar | 9b2cb69 | 2010-06-12 16:21:19 +0000 | [diff] [blame] | 15 | config.python_executable = "@PYTHON_EXECUTABLE@" |
Chandler Carruth | 15db818 | 2015-02-14 09:43:57 +0000 | [diff] [blame] | 16 | config.gold_executable = "@GOLD_EXECUTABLE@" |
Peter Collingbourne | aa01400 | 2015-03-19 23:55:38 +0000 | [diff] [blame] | 17 | config.ld64_executable = "@LD64_EXECUTABLE@" |
Michal Gorny | 1159e42 | 2017-01-06 21:33:48 +0000 | [diff] [blame] | 18 | config.llvm_tool_lto_build = @LLVM_TOOL_LTO_BUILD@ |
Peter Zotov | 47f88b5 | 2014-10-30 08:29:45 +0000 | [diff] [blame] | 19 | config.ocamlfind_executable = "@OCAMLFIND@" |
Michal Gorny | 1159e42 | 2017-01-06 21:33:48 +0000 | [diff] [blame] | 20 | config.have_ocamlopt = @HAVE_OCAMLOPT@ |
| 21 | config.have_ocaml_ounit = @HAVE_OCAML_OUNIT@ |
Peter Zotov | b4d023a | 2014-10-28 22:39:36 +0000 | [diff] [blame] | 22 | config.ocaml_flags = "@OCAMLFLAGS@" |
Michal Gorny | 1159e42 | 2017-01-06 21:33:48 +0000 | [diff] [blame] | 23 | config.include_go_tests = @LLVM_INCLUDE_GO_TESTS@ |
Peter Collingbourne | 798ace2 | 2014-10-16 22:48:02 +0000 | [diff] [blame] | 24 | config.go_executable = "@GO_EXECUTABLE@" |
NAKAMURA Takumi | b3ccc12 | 2010-11-29 00:20:09 +0000 | [diff] [blame] | 25 | config.enable_shared = @ENABLE_SHARED@ |
Andrew Trick | 75d3387 | 2011-06-23 17:52:36 +0000 | [diff] [blame] | 26 | config.enable_assertions = @ENABLE_ASSERTIONS@ |
Eli Bendersky | 0f0c411 | 2012-02-16 06:28:33 +0000 | [diff] [blame] | 27 | config.targets_to_build = "@TARGETS_TO_BUILD@" |
Mehdi Amini | deacdc2 | 2015-08-04 06:32:31 +0000 | [diff] [blame] | 28 | config.native_target = "@LLVM_NATIVE_ARCH@" |
Peter Collingbourne | 798ace2 | 2014-10-16 22:48:02 +0000 | [diff] [blame] | 29 | config.llvm_bindings = "@LLVM_BINDINGS@".split(' ') |
Kuba Brecka | 7796c35 | 2015-01-24 01:42:44 +0000 | [diff] [blame] | 30 | config.host_os = "@HOST_OS@" |
Peter Collingbourne | 798ace2 | 2014-10-16 22:48:02 +0000 | [diff] [blame] | 31 | config.host_cc = "@HOST_CC@" |
| 32 | config.host_cxx = "@HOST_CXX@" |
Chandler Carruth | 14e55b1 | 2014-10-21 00:36:28 +0000 | [diff] [blame] | 33 | config.host_ldflags = "@HOST_LDFLAGS@" |
Michal Gorny | 1159e42 | 2017-01-06 21:33:48 +0000 | [diff] [blame] | 34 | config.llvm_use_intel_jitevents = @LLVM_USE_INTEL_JITEVENTS@ |
Alexey Samsonov | 3fbb840 | 2013-03-26 08:27:39 +0000 | [diff] [blame] | 35 | config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" |
Michal Gorny | 1159e42 | 2017-01-06 21:33:48 +0000 | [diff] [blame] | 36 | config.have_zlib = @HAVE_LIBZ@ |
| 37 | config.have_libxar = @HAVE_LIBXAR@ |
Michal Gorny | a50b783 | 2017-01-02 18:19:35 +0000 | [diff] [blame] | 38 | config.have_dia_sdk = @LLVM_ENABLE_DIA_SDK@ |
Michal Gorny | 1159e42 | 2017-01-06 21:33:48 +0000 | [diff] [blame] | 39 | config.enable_ffi = @LLVM_ENABLE_FFI@ |
Lang Hames | 91c25db | 2018-09-26 16:26:59 +0000 | [diff] [blame] | 40 | config.enable_threads = @LLVM_ENABLE_THREADS@ |
Michal Gorny | 4d35239 | 2017-01-06 21:33:54 +0000 | [diff] [blame] | 41 | config.build_shared_libs = @BUILD_SHARED_LIBS@ |
Sam Clegg | 88d22be | 2017-10-18 19:37:30 +0000 | [diff] [blame] | 42 | config.link_llvm_dylib = @LLVM_LINK_LLVM_DYLIB@ |
Sam Clegg | 1691560 | 2017-10-18 20:46:05 +0000 | [diff] [blame] | 43 | config.llvm_libxml2_enabled = "@LLVM_LIBXML2_ENABLED@" |
Jake Ehrlich | 56898c1 | 2017-11-02 23:14:55 +0000 | [diff] [blame] | 44 | config.llvm_host_triple = '@LLVM_HOST_TRIPLE@' |
Jake Ehrlich | c7ddffc | 2017-11-02 23:45:51 +0000 | [diff] [blame] | 45 | config.host_arch = "@HOST_ARCH@" |
Adam Nemet | d3ee065 | 2017-11-29 17:07:41 +0000 | [diff] [blame] | 46 | config.have_opt_viewer_modules = @LLVM_HAVE_OPT_VIEWER_MODULES@ |
Daniel Dunbar | fb76ffb | 2009-09-22 07:38:33 +0000 | [diff] [blame] | 47 | |
NAKAMURA Takumi | d420e7b | 2010-11-27 13:10:11 +0000 | [diff] [blame] | 48 | # Support substitution of the tools_dir with user parameters. This is |
| 49 | # used when we can't determine the tool dir at configuration time. |
| 50 | try: |
Daniel Dunbar | 27c35d9 | 2013-08-09 16:22:05 +0000 | [diff] [blame] | 51 | config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params |
Jordan Rose | ecc59f2 | 2014-01-02 19:47:45 +0000 | [diff] [blame] | 52 | config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params |
Daniel Dunbar | 4229b95 | 2013-08-07 23:09:10 +0000 | [diff] [blame] | 53 | except KeyError: |
| 54 | e = sys.exc_info()[1] |
NAKAMURA Takumi | d420e7b | 2010-11-27 13:10:11 +0000 | [diff] [blame] | 55 | key, = e.args |
Daniel Dunbar | 27c35d9 | 2013-08-09 16:22:05 +0000 | [diff] [blame] | 56 | lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) |
NAKAMURA Takumi | d420e7b | 2010-11-27 13:10:11 +0000 | [diff] [blame] | 57 | |
Fangrui Song | 9eedf73 | 2018-08-31 00:22:20 +0000 | [diff] [blame] | 58 | import lit.llvm |
Nico Weber | fbac6f0 | 2018-08-30 22:13:34 +0000 | [diff] [blame] | 59 | lit.llvm.initialize(lit_config, config) |
Zachary Turner | 4af1a22 | 2017-09-16 18:46:21 +0000 | [diff] [blame] | 60 | |
Daniel Dunbar | fb76ffb | 2009-09-22 07:38:33 +0000 | [diff] [blame] | 61 | # Let the main config do the real work. |
Zachary Turner | 1e4a125 | 2017-09-21 00:24:52 +0000 | [diff] [blame] | 62 | lit_config.load_config(config, "@LLVM_SOURCE_DIR@/test/lit.cfg.py") |