浏览代码

Tests/RunCMake/Ninja: fix subdir prefix check

If the output path prefix is empty, the directory is going to exist.
Ben Boeckel 2 年之前
父节点
当前提交
c6445c615b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Tests/RunCMake/Ninja/CheckNoPrefixSubDirScript.cmake

+ 1 - 1
Tests/RunCMake/Ninja/CheckNoPrefixSubDirScript.cmake

@@ -1,6 +1,6 @@
 # Check that the prefix sub-directory is not repeated.
 # Check that the prefix sub-directory is not repeated.
 
 
-if(EXISTS "${CUR_BIN_DIR}/${NINJA_OUTPUT_PATH_PREFIX}")
+if(NINJA_OUTPUT_PATH_PREFIX AND EXISTS "${CUR_BIN_DIR}/${NINJA_OUTPUT_PATH_PREFIX}")
   message(FATAL_ERROR
   message(FATAL_ERROR
     "no sub directory named after the CMAKE_NINJA_OUTPUT_PATH_PREFIX "
     "no sub directory named after the CMAKE_NINJA_OUTPUT_PATH_PREFIX "
     "should be in the binary directory."
     "should be in the binary directory."