• Chris Austen's avatar
    Adjust HIP_COMPILER_FLAGS to support <$:$<>:> and SHELL: tags (#933) (#956) · f89f6c4b
    Chris Austen authored
    
    
    In ROCm 4.5.0 hip compile flags are coming in differently.  This has
    caused some parsing issues for the HIP_COMPILER_FLAGS variable.  As an example
    
        ROCm 4.3.0: --offload-arch=gfx900
        ROCm 4.5.0: <$<COMPILE_LANGUAGE:CXX>:SHELL:--offload-arch=gfx900>
    
    Using existing code...
        $<$<COMPILE_LANGUAGE:CXX>:SHELL:--offload-arch=gfx900>
    Becomes...
        $<$<COMPILE_LANGUAGE:CXX>:SHELL:
    
    There are two problems with that.
      1) The "<" is not balanced with a "> due to the regex consuming the ">"
      2) There is still a `SHELL:`  label.
    
    This commit repairs both.  I took the regex parsing code from ROCmSoftwarePlatform/MIOpen/blame/develop/CMakeLists.txt
    but improved it to support handling of target features like
    <$<COMPILE_LANGUAGE:CXX>:SHELL:--offload-arch=gfx900:xxx+>
    Co-authored-by: default avatarPaul Fultz II <pfultz2@yahoo.com>
    Co-authored-by: default avatarPaul Fultz II <pfultz2@yahoo.com>
    f89f6c4b
CMakeLists.txt 8.67 KB