summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Niklas Hasse <jhasse@bixense.com>2021-02-23 22:01:06 (GMT)
committerGitHub <noreply@github.com>2021-02-23 22:01:06 (GMT)
commit100efbaf550f07c3b09d67489dad0c0ed5a6e542 (patch)
tree3fbfe39293051698929c24bf351f5a01366c7deb
parent5c9334340675bbfed4aff10bd30e63b872191f0b (diff)
parentaa9317e42fadb7f84498f555620a8f89c9afd9f3 (diff)
downloadNinja-100efbaf550f07c3b09d67489dad0c0ed5a6e542.zip
Ninja-100efbaf550f07c3b09d67489dad0c0ed5a6e542.tar.gz
Ninja-100efbaf550f07c3b09d67489dad0c0ed5a6e542.tar.bz2
Merge pull request #1916 from scivision/check_msg
cmake: add browse check status
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e0696ff..8de69e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,6 +55,7 @@ target_include_directories(libninja-re2c PRIVATE src)
function(check_platform_supports_browse_mode RESULT)
# Make sure the inline.sh script works on this platform.
# It uses the shell commands such as 'od', which may not be available.
+
execute_process(
COMMAND sh -c "echo 'TEST' | src/inline.sh var"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
@@ -65,12 +66,19 @@ function(check_platform_supports_browse_mode RESULT)
if(NOT inline_result EQUAL "0")
# The inline script failed, so browse mode is not supported.
set(${RESULT} "0" PARENT_SCOPE)
+ if(NOT WIN32)
+ message(WARNING "browse feature omitted due to inline script failure")
+ endif()
return()
endif()
# Now check availability of the unistd header
check_include_file_cxx(unistd.h PLATFORM_HAS_UNISTD_HEADER)
set(${RESULT} "${PLATFORM_HAS_UNISTD_HEADER}" PARENT_SCOPE)
+ if(NOT PLATFORM_HAS_UNISTD_HEADER)
+ message(WARNING "browse feature omitted due to missing unistd.h")
+ endif()
+
endfunction()
check_platform_supports_browse_mode(platform_supports_ninja_browse)