forked from Imagelibrary/seL4
cmake: cater for BSD stat command on MacOS X
MacOS X has a BSD-style `stat`, this commit selects the `stat` command line arguments based on the host OS. As a small step towards enabling building the kernel on MacOS X, at least to the degree that kernel.elf can be produced as needed in verification. Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
This commit is contained in:
committed by
Gerwin Klein
parent
4de3d4f5d9
commit
7963343a74
@@ -152,10 +152,15 @@ if(DEFINED KernelDTSList AND (NOT "${KernelDTSList}" STREQUAL ""))
|
|||||||
if(error)
|
if(error)
|
||||||
message(FATAL_ERROR "Failed to compile DTS to DTB: ${KernelDTBPath}")
|
message(FATAL_ERROR "Failed to compile DTS to DTB: ${KernelDTBPath}")
|
||||||
endif()
|
endif()
|
||||||
|
# CMAKE_HOST_APPLE is a built-in CMake variable
|
||||||
|
if(CMAKE_HOST_APPLE)
|
||||||
|
set(STAT_ARGS "-f%z")
|
||||||
|
else()
|
||||||
|
set(STAT_ARGS "-c '%s'")
|
||||||
|
endif()
|
||||||
# Track the size of the DTB for downstream tools
|
# Track the size of the DTB for downstream tools
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND
|
COMMAND ${STAT_TOOL} ${STAT_ARGS} ${KernelDTBPath}
|
||||||
${STAT_TOOL} -c '%s' ${KernelDTBPath}
|
|
||||||
OUTPUT_VARIABLE KernelDTBSize
|
OUTPUT_VARIABLE KernelDTBSize
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
RESULT_VARIABLE error
|
RESULT_VARIABLE error
|
||||||
|
|||||||
Reference in New Issue
Block a user