Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Tooling/CMakeLists.txt
Show All 26 Lines | |||||
if (NOT Python3_EXECUTABLE | if (NOT Python3_EXECUTABLE | ||||
OR WIN32 | OR WIN32 | ||||
OR APPLE | OR APPLE | ||||
OR GENERATOR_IS_MULTI_CONFIG | OR GENERATOR_IS_MULTI_CONFIG | ||||
OR NOT LLVM_NATIVE_ARCH IN_LIST LLVM_TARGETS_TO_BUILD | OR NOT LLVM_NATIVE_ARCH IN_LIST LLVM_TARGETS_TO_BUILD | ||||
OR NOT X86 IN_LIST LLVM_TARGETS_TO_BUILD | OR NOT X86 IN_LIST LLVM_TARGETS_TO_BUILD | ||||
) | ) | ||||
file(GENERATE OUTPUT ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc | configure_file( | ||||
CONTENT " | EmptyNodeIntrospection.inc.in | ||||
namespace clang { | ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc | ||||
namespace tooling { | COPYONLY | ||||
thakis: Is configure_file(COYPONLY) different from file(COPY)? In what way?
Are you expecting to use… | |||||
configure_file only copies the file if it is different. file(COPY) does too, but it doesn't seem to include a way to specify the destination file name. steveire: `configure_file` only copies the file if it is different. `file(COPY)` does too, but it doesn't… | |||||
NodeLocationAccessors NodeIntrospection::GetLocations(clang::Stmt const *) { | |||||
return {}; | |||||
} | |||||
NodeLocationAccessors | |||||
NodeIntrospection::GetLocations(clang::DynTypedNode const &) { | |||||
return {}; | |||||
} | |||||
} // namespace tooling | |||||
} // namespace clang | |||||
" | |||||
) | ) | ||||
set(CLANG_TOOLING_BUILD_AST_INTROSPECTION "OFF" CACHE BOOL "") | set(CLANG_TOOLING_BUILD_AST_INTROSPECTION "OFF" CACHE BOOL "") | ||||
else() | else() | ||||
# The generation of ASTNodeAPI.json takes a long time in a | # The generation of ASTNodeAPI.json takes a long time in a | ||||
# Debug build due to parsing AST.h. Disable the processing | # Debug build due to parsing AST.h. Disable the processing | ||||
# but setting CLANG_TOOLING_BUILD_AST_INTROSPECTION as an | # but setting CLANG_TOOLING_BUILD_AST_INTROSPECTION as an | ||||
# internal hidden setting to override. | # internal hidden setting to override. | ||||
# When the processing is disabled, a trivial/empty JSON | # When the processing is disabled, a trivial/empty JSON | ||||
Show All 34 Lines | ") | ||||
add_custom_target(run-ast-api-dump-tool | add_custom_target(run-ast-api-dump-tool | ||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json | DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json | ||||
) | ) | ||||
add_custom_command( | add_custom_command( | ||||
COMMENT Generate NodeIntrospection.inc | COMMENT Generate NodeIntrospection.inc | ||||
OUTPUT ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc | OUTPUT ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc | ||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json | DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json | ||||
${CMAKE_CURRENT_SOURCE_DIR}/DumpTool/generate_cxx_src_locs.py | ${CMAKE_CURRENT_SOURCE_DIR}/DumpTool/generate_cxx_src_locs.py | ||||
${CMAKE_CURRENT_SOURCE_DIR}/EmptyNodeIntrospection.inc.in | |||||
You need to add a dep on the inc file here so that this step reruns if EmptyNodeIntrospection.inc changes. thakis: You need to add a dep on the inc file here so that this step reruns if EmptyNodeIntrospection. | |||||
COMMAND | COMMAND | ||||
${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/DumpTool/generate_cxx_src_locs.py | ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/DumpTool/generate_cxx_src_locs.py | ||||
--json-input-path ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json | --json-input-path ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json | ||||
--output-file NodeIntrospection.inc | --output-file NodeIntrospection.inc | ||||
--empty-implementation ${skip_expensive_processing} | --use-empty-implementation ${skip_expensive_processing} | ||||
--empty-implementation | |||||
"${CMAKE_CURRENT_SOURCE_DIR}/EmptyNodeIntrospection.inc.in" | |||||
Not Done ReplyInline ActionsWhat's the advantage of making a copy above? Why not call the checked-in file EmptyNodeIntrospection.inc and pass the path to it directly here? thakis: What's the advantage of making a copy above? Why not call the checked-in file… | |||||
I'm not sure what you mean. The configure_file is inside the if and this line is inside the else. Does that clear it up? steveire: I'm not sure what you mean. The `configure_file` is inside the `if` and this line is inside the… | |||||
Not Done ReplyInline ActionsOh, I see. Maybe we could always call the py script and only make it copy through the empty file if the script isn't supposed to do anything? thakis: Oh, I see. Maybe we could always call the py script and only make it copy through the empty… | |||||
COMMAND | COMMAND | ||||
${CMAKE_COMMAND} -E copy_if_different | ${CMAKE_COMMAND} -E copy_if_different | ||||
${CMAKE_CURRENT_BINARY_DIR}/NodeIntrospection.inc | ${CMAKE_CURRENT_BINARY_DIR}/NodeIntrospection.inc | ||||
${BINARY_INCLUDE_DIR}/NodeIntrospection.inc | ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc | ||||
) | ) | ||||
add_custom_target(run-ast-api-generate-tool | add_custom_target(run-ast-api-generate-tool | ||||
DEPENDS | DEPENDS | ||||
Show All 39 Lines |
Is configure_file(COYPONLY) different from file(COPY)? In what way?
Are you expecting to use cmake vars in the .in file eventually?