Skip to content

Fixed always rebuild issue in cmake. #7512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions schema/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endif()

# The include directory that will contain the generated schema headers.
set(_program_schema__include_dir "${CMAKE_BINARY_DIR}/schema/include")

set(_program_schema__output_dir "${_program_schema__include_dir}/executorch/schema")
# Source root directory for executorch.
if(NOT EXECUTORCH_ROOT)
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..)
Expand All @@ -26,7 +26,7 @@ function(generate_program_schema _schema_srcs _schema_name)
foreach(fbs_file ${_schema_srcs})
string(REGEX REPLACE "[.]fbs$" "_generated.h" generated "${fbs_file}")
list(APPEND _schema_outputs
"${_program_schema__include_dir}/executorch/${generated}"
"${_program_schema__output_dir}/${generated}"
)
endforeach()

Expand All @@ -35,7 +35,7 @@ function(generate_program_schema _schema_srcs _schema_name)
OUTPUT ${_schema_outputs}
COMMAND
${FLATC_EXECUTABLE} --cpp --cpp-std c++11 --gen-mutable --scoped-enums -o
"${_program_schema__include_dir}/executorch/schema" ${_schema_srcs}
"${_program_schema__output_dir}" ${_schema_srcs}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${FLATC_EXECUTABLE} ${_schema_srcs}
COMMENT "Generating ${_schema_name} headers"
Expand Down
Loading