<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/121297>121297</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            CMake doesn't support IPO for current CUDA compiler
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          eduardz1
      </td>
    </tr>
</table>

<pre>
    When trying to compile my CUDA project with LTO enabled I get the error `CMAKE doesn't support IPO for current CUDA compiler`. In my root CMakeLists.txt file I have the check defined in this way:

```cmake
cmake_minimum_required(VERSION 3.27...3.31)

if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
  set(CMAKE_CUDA_ARCHITECTURES 50)
endif()

project(
    cuda_path_tracer
    VERSION 1.0
 LANGUAGES CXX CUDA
)

include(CheckIPOSupported)
check_ipo_supported(RESULT supported OUTPUT error)

if (supported)
    set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
    message(WARNING "IPO is not supported: ${error}")
endif()

...
```

Shouldn't LTO be supported with clang? I am currently using clang20
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUU8GOozgQ_RpzKQ0CE0Jy4MAkpBdtOokI2RntBRkowNuAs7bp3uzXrwyZTPbQh5EsWSrbr149v8eU4s2AGBL_K_G3Fht1K2SI1chk9a9rFaK6hd9aHEDLGx8a0AJK0V95h9DfYHPZRnCV4i8sNXxw3cI-OwIOrOiwggQa1KBbBJRSSCBLZ_Ma_R5DJVANhAYa1Hi9CqkhOR2hFhLKUUoc9Ax8byTJ0rEhGUxDKYSGzSt7wz1XWtn6Hw21IZNAy95xala2WL5BhTUfsAI-gG65gg92I15EnGktnXmVPXtD4kTTnvd84P3Y5xL_HrnEitDVH3F6To4H8Gwa2Lbt2Z5L6HpG4TWhq8Mxg228Sw7xFqbhckM9j9LNb0kWb7JLGp_nFwAKNaGrz26B78wXcagm6Eeju8CmZGAAyrFi-ZXpNteSlSjv5R9kXdsxlX10eLlEL_EZNt-_T4oauAf7oezGCg0ho1dyOp7nvzBzmzuTjDm_ilz9PFil8fmyz-BRguMlO12y-YefpAFCV-r_gIbiswTJIYvTU3rcxNtLGu3z4ylLXpM_o8zMkKWX-C5Hp_ChhsHoUSnWmNq3KD0khxcglBoDcQWD0D-5ES8CQhck-DqzC7aE0k80tm372Rhz8dyKsatmpxpjF_g0-GT3smNDQ7wdJMD6H-7tbjAqE5bplDpWFXrV2lszC0M38PzFyl-7vtWGdeVjvfSw8Orlqg4q36GLAhdr6hdYLFlg8ZA6dOFSunZ96ru-Tdl6uSoCVi9rfxEElCwc7Bnv7K57720hG4srNWLoUpeuA6tjBXZqCjelA37AdGpU8LeWDM2jL8XYKLJwuilPDxjNdYfhlLRfjas1yi5stb4qEzi6I3TXcN2OhV2KntCd6XHfvjysvZuYKUJ3d-rvIf0vAAD__-5WbKI">