Skip to content

Commit

Permalink
[cmake] ExternalProject_Add is unhappy about CMAKE_ARGS having quotes.
Browse files Browse the repository at this point in the history
In some cases we pass paths in quotes in CMAKE_CXX_FLAGS and that seems to
confuse the ExternalProject_Add logic of our benchmarks.
  • Loading branch information
vgvassilev committed Jan 7, 2024
1 parent be45c95 commit f0d4988
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmake/modules/GoogleBenchmark.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ string(REPLACE "${GCC_COVERAGE_COMPILE_FLAGS}" "" CMAKE_SHARED_LIBRARY_CREATE_CX
string(REPLACE "${GCC_COVERAGE_LINK_FLAGS}" "" CMAKE_EXE_LINKER_FLAGS_NOCOV "${CMAKE_EXE_LINKER_FLAGS}")
string(REPLACE "${GCC_COVERAGE_LINK_FLAGS}" "" CMAKE_SHARED_LINKER_FLAGS_NOCOV "${CMAKE_SHARED_LINKER_FLAGS}")

# ExternalProject_Add does not like unescaped quotes in CMAKE_ARGS.
string(REPLACE "\"" "\\\"" ESCAPED_CMAKE_CXX_FLAGS_NOCOV "${CMAKE_CXX_FLAGS_NOCOV}")
string(REPLACE "\"" "\\\"" ESCAPED_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")

include(ExternalProject)
#---Find and install google benchmark
ExternalProject_Add(
googlebenchmark
Expand Down

0 comments on commit f0d4988

Please sign in to comment.