# CMAKE\_CUDA\_HOST\_COMPILER reset to empty after enable\_language(CUDA) for CMake v3.17.3

**URL:** <https://discourse.cmake.org/t/cmake-cuda-host-compiler-reset-to-empty-after-enable-language-cuda-for-cmake-v3-17-3/1381>\
**Category:** Code\
**Tags:** os:linux, lang:cuda\
**Created:** [June 12, 2020, 7:06pm UTC](https://discourse.cmake.org/t/cmake-cuda-host-compiler-reset-to-empty-after-enable-language-cuda-for-cmake-v3-17-3/1381 "2020-06-12T19:06:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Triston\_C](https://discourse.cmake.org/user_avatar/discourse.cmake.org/triston_c/32/683_2.png) [@Triston\_C](https://discourse.cmake.org/u/Triston_C)\
**Post date:** [June 12, 2020, 7:06pm UTC](https://discourse.cmake.org/t/cmake-cuda-host-compiler-reset-to-empty-after-enable-language-cuda-for-cmake-v3-17-3/1381/1 "2020-06-12T19:06:33Z")

</div>

My CMAKE\_CUDA\_HOST\_COMPILER was set as aarch64-linux-gnu-gcc. After enable\_language(CUDA), the var is set to empty string. The problem did not happene in v3.17.2.

message(STATUS “CMAKE\_CUDA\_HOST\_COMPILER=${CMAKE\_CUDA\_HOST\_COMPILER}”)  
enable\_language(CUDA)  
message(STATUS “CMAKE\_CUDA\_HOST\_COMPILER=${CMAKE\_CUDA\_HOST\_COMPILER}”)  
– CMAKE\_CUDA\_HOST\_COMPILER=aarch64-linux-gnu-gcc  
– CMAKE\_CUDA\_HOST\_COMPILER=

I put this into the cmake issue [https://gitlab.kitware.com/cmake/cmake/-/issues/20826](https://gitlab.kitware.com/cmake/cmake/-/issues/20826)
