ProcessorCount: Test fails if count is 0 (#11302)

It also fails if count is not a decimal integer.
This commit is contained in:
David Cole 2011-03-09 16:21:10 -05:00 committed by Brad King
parent 6dd74d5a59
commit 4dd2ec2cb9
1 changed files with 5 additions and 4 deletions

View File

@ -25,9 +25,11 @@ message("")
# Evaluate possible error conditions: # Evaluate possible error conditions:
# #
set(err 0) set(err 0)
set(fatal 0)
if(processor_count EQUAL 0) if(processor_count EQUAL 0)
set(err 1) set(err 1)
set(fatal 1)
message("err 1") message("err 1")
message("could not determine number of processors message("could not determine number of processors
- Additional code for this platform needed in ProcessorCount.cmake?") - Additional code for this platform needed in ProcessorCount.cmake?")
@ -45,6 +47,7 @@ endif()
if(NOT processor_count MATCHES "^[0-9]+$") if(NOT processor_count MATCHES "^[0-9]+$")
set(err 3) set(err 3)
set(fatal 1)
message("err 3") message("err 3")
message("ProcessorCount function returned a non-integer") message("ProcessorCount function returned a non-integer")
message("") message("")
@ -57,8 +60,6 @@ if(NOT system_info_processor_count MATCHES "^[0-9]+$")
message("") message("")
endif() endif()
# TODO: Make this test fail again, once all the dev work is done... if(fatal)
# message(FATAL_ERROR "processor_count='${processor_count}' - see previous test output for more details - it is likely more/different code is needed in ProcessorCount.cmake to fix this test failure - processor_count should be a non-zero positive integer (>=1) for all supported CMake platforms")
if(err)
# message(FATAL_ERROR "err='${err}'")
endif() endif()