From b41599584362f80869f69a041e47418a2e65f63b Mon Sep 17 00:00:00 2001 From: Abdul Dakkak Date: Wed, 27 Apr 2022 18:16:14 -0700 Subject: [PATCH] [loadgen]: Allow one to pass in custom CXX_FLAGS by passing the MLPERF_LOADGEN_CXX_FLAGS cmake variable. This allows upstream projects to specify extra CXX_FLAGs. --- loadgen/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/loadgen/CMakeLists.txt b/loadgen/CMakeLists.txt index d6a5ec813..abd3ac56a 100644 --- a/loadgen/CMakeLists.txt +++ b/loadgen/CMakeLists.txt @@ -11,6 +11,10 @@ message("mlperf_loadgen v${mlperf_loadgen_VERSION_MAJOR}.${mlperf_loadgen_VERSIO if (NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -W -Wall") endif() +# Extra build options can be specified by setting the MLPERF_LOADGEN_CXX_FLAGS variable +if (MLPERF_LOADGEN_CXX_FLAGS) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MLPERF_LOADGEN_CXX_FLAGS}") +endif() message(STATUS "Using C++ compiler flags: ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_STANDARD "14") message(STATUS "Using C++ standard: ${CMAKE_CXX_STANDARD}")