Skip to content

Commit

Permalink
cmake: fix warnings in external projects code
Browse files Browse the repository at this point in the history
With 3.31:
```
Keyword WORKING_DIRECTORY requires a value, but none was given.

  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
  Keyword WORKING_DIRECTORY requires a value, but none was given.
```

Additionally, make calls to `add_custom_command` stricter starting with 3.31.
  • Loading branch information
benoit-pierre authored and Frenzie committed Nov 8, 2024
1 parent 09c0511 commit 8d46979
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion thirdparty/cmake_modules/koreader_external_project.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ if(POLICY CMP0116)
cmake_policy(SET CMP0116 NEW)
endif()

# Stricter `add_custom_command()` (rejects invalid argument(s)).
if(POLICY CMP0175)
cmake_policy(SET CMP0175 NEW)
endif()

# Crappy macOS command line utilities strike again…
set(PRINTF_QS "%q")
if(CMAKE_HOST_APPLE)
Expand Down Expand Up @@ -65,8 +70,10 @@ function(external_project_step NAME)
DEPENDS $<TARGET_PROPERTY:${PROJECT_NAME}-${NAME},DEPENDS>
VERBATIM
${_USES_TERMINAL}
WORKING_DIRECTORY ${_WORKING_DIRECTORY}
)
if(DEFINED _WORKING_DIRECTORY)
list(APPEND SPEC WORKING_DIRECTORY ${_WORKING_DIRECTORY})
endif()
if(DEFINED _DEPFILE)
list(APPEND SPEC DEPFILE ${_DEPFILE})
endif()
Expand Down

0 comments on commit 8d46979

Please sign in to comment.