From 7b2d305d6c16cbd503a1ad2c2312697e8e484ad6 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Sun, 2 Sep 2018 16:50:15 +0100 Subject: [PATCH] [tapi, test] Allow the use of a specified sysroot. --- test/CMakeLists.txt | 2 ++ test/lit.cfg | 3 ++- test/lit.site.cfg.in | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git tapi/test/CMakeLists.txt tapi/test/CMakeLists.txt index 90fe6c4..50e91c4 100644 --- tapi/test/CMakeLists.txt +++ tapi/test/CMakeLists.txt @@ -53,7 +53,9 @@ ExternalProject_Add(TestInputs -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} + -DCMAKE_SYSROOT=${CMAKE_SYSROOT} -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} + -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -DCMAKE_BUILD_TYPE=Release LOG_CONFIGURE 1 LOG_BUILD 1 diff --git tapi/test/lit.cfg tapi/test/lit.cfg index fd08bbe..92d45a4 100644 --- tapi/test/lit.cfg +++ tapi/test/lit.cfg @@ -264,7 +264,8 @@ config.inputs = os.path.join(tapi_obj_root, 'Inputs') config.tapi = infer_tapi(config.environment['PATH']).replace('\\', '/') config.tapi_run = infer_tapi_run(config.environment['PATH']).replace('\\', '/') config.tapi_frontend = infer_tapi_frontend(config.environment['PATH']).replace('\\', '/') -config.sysroot = get_macos_sdk_path(config) +if config.sysroot == '': + config.sysroot = get_macos_sdk_path(config) lit_config.note('using SDKROOT: %r' % config.sysroot) config.substitutions.append( ('%inputs', config.inputs) ) diff --git tapi/test/lit.site.cfg.in tapi/test/lit.site.cfg.in index 5e54c18..0fc027b 100644 --- tapi/test/lit.site.cfg.in +++ tapi/test/lit.site.cfg.in @@ -9,6 +9,7 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.tapi_obj_root = "@TAPI_BINARY_DIR@" config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" +config.sysroot = "@TAPI_SYSROOT@" # Support substitution of the tools and libs dirs with user parameters. This is