File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# CMake
22build /
3+ _buildconfig.py
34
45# Cargo
56target /
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ execute_process(
5050)
5151message (STATUS ${CLANG_OUTPUT} )
5252
53+ include (${CMAKE_CURRENT_SOURCE_DIR } /cmake/generate-buildconfig-py.cmake )
54+ generate_buildconfig_py ("${CMAKE_CURRENT_SOURCE_DIR } /tests/lit/lit" )
55+
5356include (${CMAKE_CURRENT_SOURCE_DIR } /cmake/rust-toolchain.cmake )
5457set (RUST_STAMP_FILE "${CMAKE_BINARY_DIR } /.rust-toolchain.stamp" )
5558
Original file line number Diff line number Diff line change 1+ function (generate_buildconfig_py outdir )
2+ file (CONFIGURE
3+ OUTPUT "${outdir} /_buildconfig.py"
4+ CONTENT [[
5+ """Generated by CMake, do not edit."""
6+
7+ from pathlib import Path
8+
9+ CXX = Path(r"@CMAKE_CXX_COMPILER@")
10+ CC = Path(r"@CMAKE_C_COMPILER@")
11+ ]]
12+ ESCAPE_QUOTES
13+ @ONLY
14+ )
15+ endfunction ()
Original file line number Diff line number Diff line change 33
44import lit .Test
55import lit .util
6+ from .._buildconfig import CXX , CC
67from .base import TestFormat
78from dataclasses import dataclass
89from pathlib import Path
@@ -177,12 +178,7 @@ def build_cpp(self):
177178 self .cpp_bin = self .build_dir / "app"
178179 return None
179180
180- ## FIXME: these must use the detected/chosen compiler in cmake
181- cc = (
182- os .environ .get ("CC" , "clang" )
183- if self .cc_input .suffix == ".c"
184- else os .environ .get ("CXX" , "clang++" )
185- )
181+ cc = CC if self .cc_input .suffix == ".c" else CXX
186182 self .cpp_bin = self .tmp_dir / "cpp"
187183 cmd = [
188184 cc ,
You can’t perform that action at this time.
0 commit comments