cmake: Only use -fprofile-dir when PGO is used

It stops clang from warning that '-fprofile-dir' is not supported.
This commit is contained in:
Jonathan Li 2016-12-10 21:51:21 +00:00
parent a83042d5c0
commit afe86a5f66
1 changed files with 3 additions and 1 deletions

View File

@ -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.")