Skip to content

Commit 1e482ab

Browse files
committed
cmake: don't use file(REAL_PATH)
1 parent 9fd897e commit 1e482ab

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

cmake/FlatccGenerateSources.cmake

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,17 @@ function(flatcc_generate_sources)
136136
endif()
137137

138138
set(ABSOLUTE_DEFINITION_FILES)
139+
140+
foreach(definition_file ${FLATCC_DEFINITION_FILES})
141+
# TODO: file(REAL_PATH) if cmake_minimum_Version >= 3.19
142+
if(IS_ABSOLUTE "${definition_file}")
143+
set(absolute_def_file "${definition_file}")
144+
else()
145+
set(absolute_def_file "${CMAKE_CURRENT_SOURCE_DIR}/${definition_file}")
146+
endif()
147+
list(APPEND ABSOLUTE_DEFINITION_FILES "${absolute_def_file}")
148+
endforeach()
149+
139150
set(OUTPUT_FILES)
140151
if(FLATCC_OUTFILE)
141152
list(APPEND FLATCC_COMPILE_FLAGS "--outfile=${FLATCC_OUTPUT_DIR}/${FLATCC_OUTFILE}")
@@ -155,10 +166,6 @@ function(flatcc_generate_sources)
155166
list(APPEND OUTPUT_FILES "${FLATCC_OUTPUT_DIR}/flatbuffers_common_builder.h")
156167
endif()
157168
endif()
158-
foreach(definition_file ${FLATCC_DEFINITION_FILES})
159-
file(REAL_PATH "${definition_file}" absolute_def_file)
160-
list(APPEND ABSOLUTE_DEFINITION_FILES "${absolute_def_file}")
161-
endforeach()
162169

163170
message(VERBOSE "Flatcc output directory: ${FLATCC_OUTPUT_DIR}")
164171
message(VERBOSE "Flatcc output files: ${OUTPUT_FILES}")

0 commit comments

Comments
 (0)