Skip to content

Commit

Permalink
Silence CMake warning caused by PROJECT_ROOT_DIR (#47015)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #47015

CMake is complaining that this variable is set outside the build but not used.
I'm using it inside our top level .cmake file to silence this warning.
We need this variable as user projects might use it.

Changelog:
[Internal] [Changed] - Silence CMake warning caused by `PROJECT_ROOT_DIR`

Reviewed By: javache

Differential Revision: D64334462

fbshipit-source-id: 558bfc9f647e62890e3cc25628b5544880c47e4b
  • Loading branch information
cortinico authored and facebook-github-bot committed Oct 15, 2024
1 parent 3485e9e commit 44c5cc3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ if(CMAKE_HOST_WIN32)
string(REPLACE "\\" "/" BUILD_DIR ${BUILD_DIR})
endif()

if (PROJECT_ROOT_DIR)
# This empty `if` is just to silence a CMake warning and make sure the `PROJECT_ROOT_DIR`
# variable is defined if user need to access it.
endif ()

file(GLOB input_SRC CONFIGURE_DEPENDS
*.cpp
${BUILD_DIR}/generated/autolinking/src/main/jni/*.cpp)
Expand Down

0 comments on commit 44c5cc3

Please sign in to comment.