From 13fb0f9d38c0429f4f838f6f0d9c29e87305a4f7 Mon Sep 17 00:00:00 2001 From: Alejandro Ramallo Date: Tue, 25 Oct 2022 11:58:26 -0400 Subject: [PATCH 1/2] add automatic check for realpath in CMakeLists --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 779558ea787..15dbc50fc18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,6 +125,11 @@ if(NOT DEFINED FLATBUFFERS_LOCALE_INDEPENDENT) endif() add_definitions(-DFLATBUFFERS_LOCALE_INDEPENDENT=$) +check_symbol_exists(realpath "stdlib.h" HAVE_REALPATH) +if(NOT HAVE_REALPATH) + add_definitions(-DFLATBUFFERS_NO_ABSOLUTE_PATH_RESOLUTION) +endif() + set(FlatBuffers_Library_SRCS include/flatbuffers/allocator.h include/flatbuffers/array.h From e406617b4d11555de1aabe5c400d0fd0881e9d6d Mon Sep 17 00:00:00 2001 From: Alejandro Ramallo Date: Tue, 25 Oct 2022 12:15:07 -0400 Subject: [PATCH 2/2] added win32 check --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15dbc50fc18..395ac59e7c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,9 +125,11 @@ if(NOT DEFINED FLATBUFFERS_LOCALE_INDEPENDENT) endif() add_definitions(-DFLATBUFFERS_LOCALE_INDEPENDENT=$) -check_symbol_exists(realpath "stdlib.h" HAVE_REALPATH) -if(NOT HAVE_REALPATH) - add_definitions(-DFLATBUFFERS_NO_ABSOLUTE_PATH_RESOLUTION) +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