|
1 | 1 | using System.Globalization; |
2 | 2 | using System.Text; |
| 3 | +using Genbox.FastData.Generator.CPlusPlus.TestHarness.Code; |
3 | 4 | using Genbox.FastData.InternalShared; |
4 | 5 | using Genbox.FastData.InternalShared.Harness; |
5 | 6 | using Genbox.FastData.InternalShared.Helpers; |
@@ -52,7 +53,7 @@ public override BenchmarkSuite CreateFiles(IEnumerable<ITestData> data) |
52 | 53 |
|
53 | 54 | public override void Run(BenchmarkSuite suite, bool useBencher, bool useShell) |
54 | 55 | { |
55 | | - ProcessResult configureResult = ProcessHelper.RunProcess("cmake", "-S . -B build", Bootstrap.RootDir, 100_000); |
| 56 | + ProcessResult configureResult = ProcessHelper.RunProcess("cmake", "-S . -B build -DCMAKE_CXX_COMPILER=\"" + ClangCompiler.CompilerPath + "\"", Bootstrap.RootDir, 100_000); |
56 | 57 |
|
57 | 58 | if (configureResult.ExitCode != 0) |
58 | 59 | throw new InvalidOperationException($"Failed to configure CMake. Exit code: {configureResult.ExitCode}\nSTDOUT:\n{configureResult.StandardOutput}\nSTDERR:\n{configureResult.StandardError}"); |
@@ -81,6 +82,18 @@ private string RenderBenchmarkQueries(ITestData data, string identifier) |
81 | 82 | private static string BuildCMakeLists(IEnumerable<string> sources) => |
82 | 83 | $$""" |
83 | 84 | cmake_minimum_required(VERSION 3.20) |
| 85 | +
|
| 86 | + if(DEFINED ENV{FASTDATA_CLANGXX}) |
| 87 | + set(_clangxx "$ENV{FASTDATA_CLANGXX}") |
| 88 | + if(IS_DIRECTORY "${_clangxx}") |
| 89 | + set(_clangxx "${_clangxx}/clang++") |
| 90 | + endif() |
| 91 | + if(WIN32 AND NOT EXISTS "${_clangxx}" AND EXISTS "${_clangxx}.exe") |
| 92 | + set(_clangxx "${_clangxx}.exe") |
| 93 | + endif() |
| 94 | + set(CMAKE_CXX_COMPILER "${_clangxx}" CACHE FILEPATH "" FORCE) |
| 95 | + endif() |
| 96 | +
|
84 | 97 | project(fast_data_benchmarks LANGUAGES CXX) |
85 | 98 | set(CMAKE_CXX_STANDARD 17) |
86 | 99 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
|
0 commit comments