Change __HIP_ENABLE_PCH to be an option

Currently all the logic checks if __HIP_ENABLE_PCH is set, so setting it
to OFF will still enable PCH.

Switching __HIP_ENABLE_PCH to be a CMake option will enable correct
build behaviour.

Change-Id: I77a663589ffb5f2595c6ad3d144eb9466adcf250
This commit is contained in:
Vladislav Sytchenko
2020-10-05 15:15:13 -04:00
parent c4505bede3
commit 3949675ab0
2 changed files with 9 additions and 11 deletions
+2 -2
View File
@@ -156,7 +156,7 @@ endif()
# Short-Term solution for pre-compiled headers for online compilation
# Enable pre compiled header
if(${__HIP_ENABLE_PCH})
if(__HIP_ENABLE_PCH)
execute_process(COMMAND sh -c "${CMAKE_CURRENT_SOURCE_DIR}/../bin/hip_embed_pch.sh ${LLVM_DIR}")
add_definitions(-D__HIP_ENABLE_PCH)
endif()
@@ -223,7 +223,7 @@ add_library(device INTERFACE)
target_link_libraries(device INTERFACE host)
# Short-Term solution for pre-compiled headers for online compilation
if(${__HIP_ENABLE_PCH})
if(__HIP_ENABLE_PCH)
target_link_libraries(amdhip64 PRIVATE ${CMAKE_BINARY_DIR}/hip_pch.o)
endif()