Skip to content

Commit

Permalink
Silence warning on CMP0116 (#1284)
Browse files Browse the repository at this point in the history
* Silence warning on CMP0116

* Set policy when CMake version > 3.19
  • Loading branch information
justsmth authored Nov 15, 2023
1 parent 1aeb4c3 commit feb0287
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmake/go.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ function(go_executable dest package)
string(SUBSTRING "${CMAKE_CURRENT_BINARY_DIR}" ${root_dir_length} -1 target)
set(target "${target}/${dest}")

if(CMAKE_VERSION VERSION_GREATER "3.19")
# Silences warning about CMP0116:
# https://cmake.org/cmake/help/latest/policy/CMP0116.html
cmake_policy(SET CMP0116 OLD)
endif()

set(depfile "${CMAKE_CURRENT_BINARY_DIR}/${dest}.d")
add_custom_command(OUTPUT ${dest}
COMMAND ${GO_EXECUTABLE} build
Expand Down

0 comments on commit feb0287

Please sign in to comment.