Skip to content

Commit

Permalink
Remove DEPENDS from add_custom_command as CMake made the behavior cle…
Browse files Browse the repository at this point in the history
…ar (aws#2178)

### Description of changes: 
Instead of silently ignoring the parameter CMake now prints a warning
and lets the command continue to work:
```
CMake Warning (dev) at crypto/CMakeLists.txt:654 (add_custom_command):
  The following keywords are not supported when using
  add_custom_command(TARGET): DEPENDS.

  Policy CMP0175 is not set: add_custom_command() rejects invalid arguments.
  Run "cmake --help-policy CMP0175" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
```

https://cmake.org/cmake/help/latest/policy/CMP0175.html

### Testing:
Built locally after deleting the option and didn't see the error
message.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
  • Loading branch information
andrewhop authored Feb 11, 2025
1 parent 5553a20 commit 596be13
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -657,10 +657,6 @@ if(FIPS_SHARED)
COMMAND ${GO_EXECUTABLE} run
${PROJECT_SOURCE_DIR}/util/fipstools/inject_hash/inject_hash.go
-o $<TARGET_FILE:crypto> -in-object $<TARGET_FILE:crypto> ${INJECT_HASH_APPLE_FLAG}
# The DEPENDS argument to a POST_BUILD rule appears to be ignored. Thus
# go_executable isn't used (as it doesn't get built), but we list this
# dependency anyway in case it starts working in some CMake version.
DEPENDS ../util/fipstools/inject_hash/inject_hash.go
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)

Expand Down

0 comments on commit 596be13

Please sign in to comment.