message: fix HIP compilation
  FindHIP.cmake incorrectly handles shared libraries due to scoping
diff: @@ -212,11 +212,14 @@ if(GINKGO_HIP_AMDGPU)
  endforeach()
  endif()
  -if(GINKGO_STATIC_OR_SHARED MATCHES "STATIC")
  - # Debug Static: Hip requires PIC flags
  - set(GINKGO_HIPCC_OPTIONS ${GINKGO_HIP_COMPILER_FLAGS} "-std=c++14 -DGKO_COMPILING_HIP $<$<CONFIG:Debug>:-fPIC>")
  -else()
  set(GINKGO_HIPCC_OPTIONS ${GINKGO_HIP_COMPILER_FLAGS} "-std=c++14 -DGKO_COMPILING_HIP")
  -endif()
  set(GINKGO_HIP_NVCC_OPTIONS ${GINKGO_HIP_NVCC_COMPILER_FLAGS} ${GINKGO_HIP_NVCC_ARCH} ${GINKGO_HIP_NVCC_ADDITIONAL_FLAGS})
  set(GINKGO_HIP_CLANG_OPTIONS ${GINKGO_HIP_CLANG_COMPILER_FLAGS} ${GINKGO_AMD_ARCH_FLAGS})
  +# HIP's cmake support secretly carries around global state to remember
  +# whether we created any shared libraries, and sets PIC flags accordingly.
  +# CMake's scoping rules means that this makes the hip_add_* calls order- and
  +# scope-dependent, which is not good. Let's set the flags ourselves instead.
  +if(BUILD_SHARED_LIBS)
  + list(APPEND GINKGO_HIP_CLANG_OPTIONS "-fPIC")
  + list(APPEND GINKGO_HIP_NVCC_OPTIONS "--shared -Xcompiler '-fPIC'")
  +endif()
  