Skip to content

Commit

Permalink
[CMake] Enable CXXFLAGS to include -fsycl with benchmarks; Update Goo…
Browse files Browse the repository at this point in the history
…gle benchmark version

* The Google Benchmark code does not work if CMAKE_CXX_FLAGS include -fsycl due to conflicting
  C++ version requirements.
* This removes the external CXX flags for the Google Benchmark library build.
* Also update Google Benchmark version tag.
  • Loading branch information
hjabird committed Aug 12, 2024
1 parent 653fde8 commit 99184a2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,20 @@ find_package(SYCL)
set(BENCHMARK_ENABLE_TESTING OFF)
# The icpx compiler causes errors when in release mode:
set(BENCHMARK_ENABLE_WERROR OFF)

# The -fsycl sometimes passed through CMAKE_CXX_FLAGS requires C++17 which is
# incompatible with the C++ version required by benchmark.
set(CMAKE_CXX_FLAGS_TMP ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "")
# Fetch googlebenchmark:
include(FetchContent)
FetchContent_Declare(
googlebenchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG v1.7.1
GIT_TAG v1.8.5
)
FetchContent_MakeAvailable(googlebenchmark)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_TMP})

# Common function to add a benchmark
set(BENCHMARK_BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}")
Expand Down

0 comments on commit 99184a2

Please sign in to comment.