Skip to content
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

Fix ENUM_SERIALIZATION_ARGS_GEN_HEADER cmake support. #1688

Closed
wants to merge 1 commit into from
Closed
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
29 changes: 20 additions & 9 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,28 @@ function(generate_enum_serilization Tgt Input)
get_built_tool_path(enum_parser_bin enum_parser_dependency tools/enum_parser/enum_parser enum_parser)

get_filename_component(BaseName ${Input} NAME)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BaseName}_serialized.cpp ${ENUM_SERIALIZATION_ARGS_GEN_HEADER}
COMMAND
${enum_parser_bin}
${Input}
--include-path ${ENUM_SERIALIZATION_ARGS_INCLUDE_HEADERS}
--output ${CMAKE_CURRENT_BINARY_DIR}/${BaseName}_serialized.cpp
DEPENDS ${Input} ${enum_parser_dependency}
)
if (ENUM_SERIALIZATION_ARGS_GEN_HEADER)
set_property(SOURCE ${ENUM_SERIALIZATION_ARGS_GEN_HEADER} PROPERTY GENERATED On)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BaseName}_serialized.cpp ${ENUM_SERIALIZATION_ARGS_GEN_HEADER}
COMMAND
${enum_parser_bin}
${Input}
--include-path ${ENUM_SERIALIZATION_ARGS_INCLUDE_HEADERS}
--output ${CMAKE_CURRENT_BINARY_DIR}/${BaseName}_serialized.cpp
--header ${ENUM_SERIALIZATION_ARGS_GEN_HEADER}
DEPENDS ${Input} ${enum_parser_dependency}
)
else()
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BaseName}_serialized.cpp
COMMAND
${enum_parser_bin}
${Input}
--include-path ${ENUM_SERIALIZATION_ARGS_INCLUDE_HEADERS}
--output ${CMAKE_CURRENT_BINARY_DIR}/${BaseName}_serialized.cpp
DEPENDS ${Input} ${enum_parser_dependency}
)
endif()
target_sources(${Tgt} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${BaseName}_serialized.cpp)
endfunction()
Expand Down
Loading