cmake: compiler: gcc: Explicitly spell out stddef.h and limits.h
Depending on how compiler is built, it prints a different include directory with `--print-file-name=include`. What we want, instead, is directories with `stddef.h` and `include-fixed/limits.h`. This commit explicitly specify the header files we want to use, then take the directory from the returned path. Signed-off-by: Yasushi SHOJI <y-shoji@ispace-inc.com>
This commit is contained in:
parent
9336e3ee2c
commit
209a9104be
4 changed files with 8 additions and 4 deletions
|
@ -20,11 +20,12 @@ find_program(CMAKE_CXX_COMPILER clang++ ${find_program_clang_args})
|
|||
|
||||
if(NOT "${ARCH}" STREQUAL "posix")
|
||||
|
||||
foreach(file_name include include-fixed)
|
||||
foreach(file_name include/stddef.h include-fixed/limits.h)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} --print-file-name=${file_name}
|
||||
OUTPUT_VARIABLE _OUTPUT
|
||||
)
|
||||
get_filename_component(_OUTPUT "${_OUTPUT}" DIRECTORY)
|
||||
string(REGEX REPLACE "\n" "" _OUTPUT ${_OUTPUT})
|
||||
|
||||
list(APPEND NOSTDINC ${_OUTPUT})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue