-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make benchfeatures work again #857
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
set(SIMDJSON_BENCHMARK_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE) | ||
set(EXAMPLE_JSON ${CMAKE_CURRENT_SOURCE_DIR}/twitter.json PARENT_SCOPE) | ||
set(EXAMPLE_NDJSON ${CMAKE_CURRENT_SOURCE_DIR}/amazon_cellphones.ndjson PARENT_SCOPE) | ||
set(SIMDJSON_BENCHMARK_DATA_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE) | ||
set(EXAMPLE_JSON ${CMAKE_CURRENT_BINARY_DIR}/twitter.json PARENT_SCOPE) | ||
set(EXAMPLE_NDJSON ${CMAKE_CURRENT_BINARY_DIR}/amazon_cellphones.ndjson PARENT_SCOPE) | ||
|
||
# Copy static files to the build dir so they live alongside the generated ones | ||
jkeiser marked this conversation as resolved.
Show resolved
Hide resolved
|
||
file(GLOB_RECURSE example_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.json *.ndjson) | ||
foreach(example_file ${example_files}) | ||
configure_file(${example_file} ${example_file} COPYONLY) | ||
endforeach(example_file) | ||
|
||
add_subdirectory(generated) | ||
|
||
add_library(jsonexamples-data INTERFACE) | ||
target_compile_definitions(jsonexamples-data INTERFACE SIMDJSON_BENCHMARK_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/") | ||
target_compile_definitions(jsonexamples-data INTERFACE SIMDJSON_BENCHMARK_DATA_DIR="${CMAKE_CURRENT_BINARY_DIR}/") | ||
add_dependencies(jsonexamples-data ${example_files}) | ||
add_dependencies(jsonexamples-data generated-data) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
set(generated_files | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this works, obviously, but I find it confusing. Nothing else in the project seems to depend on generated_files. But benchmark/benchfeatures.cpp requires these files... Gosh. How does this work? And what happens when ruby is missing... how can benchfeatures work? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When ruby is missing, benchfeatures will fail :) This is all manual right now: you have to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is not a request on my part... but wouldn't the nice thing be to make it so that the benchfeatures is disabled if ruby is missing? (I am not asking for changes, just inquiring.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought about that, but I kinda want to keep it compiling in CI if we can. I'd rather it not rot again. |
||
utf-8.json escape.json | ||
0-structurals.json 7-structurals.json 15-structurals.json 23-structurals.json | ||
) | ||
find_package(Ruby QUIET) | ||
jkeiser marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (RUBY_EXECUTABLE) | ||
add_custom_command( | ||
OUTPUT ${generated_files} | ||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/miss-templates/*.txt | ||
COMMAND ${RUBY_EXECUTABLE} genfeaturejson.rb ${CMAKE_CURRENT_BINARY_DIR} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
) | ||
add_custom_target(generated-data DEPENDS ${generated_files}) | ||
else (RUBY_EXECUTABLE) | ||
# TODO make this work without Ruby and make it part of the normal build | ||
add_custom_target(generated-data) | ||
endif (RUBY_EXECUTABLE) |
Uh oh!
There was an error while loading. Please reload this page.