Skip to content

Commit

Permalink
fix: Build runner test only when VELOX_BUILD_TESTING enabled (#11669)
Browse files Browse the repository at this point in the history
Summary:
A minor CMake fix for #11609, to address the linking issue when `VELOX_BUILD_TESTING` is off.

```C++
20:52:36  #10 2.268 CMake Error at velox/velox/runner/tests/CMakeLists.txt:19 (target_link_libraries):
20:52:36  #10 2.268   Target "velox_local_runner_test" links to:
20:52:36  #10 2.268
20:52:36  #10 2.268     GTest::gtest
20:52:36  #10 2.268
20:52:36  #10 2.268   but the target was not found.  Possible reasons include:
20:52:36  #10 2.268
20:52:36  #10 2.268     * There is a typo in the target name.
20:52:36  #10 2.268     * A find_package call is missing for an IMPORTED target.
20:52:36  #10 2.268     * An ALIAS target is missing.
20:52:36  #10 2.268
20:52:36  #10 2.268
20:52:36  #10 2.268
20:52:36  #10 2.273 CMake Generate step failed.  Build files cannot be regenerated correctly.
20:52:36  #10 2.302 make: *** [Makefile:96: cmake-and-build] Error 1
20:52:36  #10 2.302 make: Leaving directory '/prestissimo'
20:52:36  #10 ERROR: process "/bin/sh -c EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS}     NUM_THREADS=${NUM_THREADS} make --directory=\"/prestissimo/\" cmake-and-build BUILD_TYPE=${BUILD_TYPE} BUILD_DIR=${BUILD_DIR} BUILD_BASE_DIR=${BUILD_BASE_DIR}" did not complete successfully: exit code: 2
```

Pull Request resolved: #11669

Reviewed By: zacw7

Differential Revision: D66560342

Pulled By: xiaoxmeng

fbshipit-source-id: 9f6b74c5a64f6e248cb8d86ec213ae76eb894770
  • Loading branch information
zuyu authored and facebook-github-bot committed Nov 29, 2024
1 parent 281fb04 commit af20b93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions velox/runner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

add_subdirectory(tests)
if(${VELOX_BUILD_TESTING})
add_subdirectory(tests)
endif()

velox_add_library(velox_local_runner LocalRunner.cpp LocalSchema.cpp Runner.cpp)

Expand Down

0 comments on commit af20b93

Please sign in to comment.