From afe86a5f66b0418fc6508961ab5b347838344753 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Sat, 10 Dec 2016 21:51:21 +0000 Subject: [PATCH] cmake: Only use -fprofile-dir when PGO is used It stops clang from warning that '-fprofile-dir' is not supported. --- cmake/BuildParameters.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 0214471484..b0187718cb 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -354,7 +354,9 @@ else() set(LTO_FLAGS "") endif() -set(PGO_FLAGS "-fprofile-dir=${CMAKE_SOURCE_DIR}/profile") +if (USE_PGO_GENERATE OR USE_PGO_OPTIMIZE) + set(PGO_FLAGS "-fprofile-dir=${CMAKE_SOURCE_DIR}/profile") +endif() if (USE_PGO_GENERATE) message(WARNING "PGO has not been thoroughly tested. A bug is not impossible.")