From 728c033ad68704719aaf89162417420888c5f935 Mon Sep 17 00:00:00 2001 From: Alejandro Ramallo Date: Fri, 28 Oct 2022 20:23:36 -0400 Subject: [PATCH] Add check for presence of realpath to CMakeLists.txt to support more platforms (#7603) * add automatic check for realpath in CMakeLists * added win32 check Co-authored-by: Derek Bailey --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 779558ea7..395ac59e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,6 +125,13 @@ if(NOT DEFINED FLATBUFFERS_LOCALE_INDEPENDENT) endif() add_definitions(-DFLATBUFFERS_LOCALE_INDEPENDENT=$) +if(NOT WIN32) + check_symbol_exists(realpath "stdlib.h" HAVE_REALPATH) + if(NOT HAVE_REALPATH) + add_definitions(-DFLATBUFFERS_NO_ABSOLUTE_PATH_RESOLUTION) + endif() +endif() + set(FlatBuffers_Library_SRCS include/flatbuffers/allocator.h include/flatbuffers/array.h