mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
[CMAKE] Fix 'clean' target not working
cmake was still considering the empty value of ${fake_version_inc} even if it was not defined. Reviewed By: vsapsai Differential Revision: https://reviews.llvm.org/D82847
This commit is contained in:
parent
58535386bb
commit
62153b67c4
@ -16,18 +16,32 @@ if(LLVM_APPEND_VC_REV)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(generated_files "${version_inc}")
|
||||
if (fake_version_inc)
|
||||
list(APPEND generated_files "${fake_version_inc}")
|
||||
endif()
|
||||
|
||||
# Create custom target to generate the VC revision include.
|
||||
add_custom_command(OUTPUT "${version_inc}" "${fake_version_inc}"
|
||||
DEPENDS "${llvm_vc}" "${generate_vcs_version_script}"
|
||||
COMMAND ${CMAKE_COMMAND} "-DNAMES=LLVM"
|
||||
"-DLLVM_SOURCE_DIR=${llvm_source_dir}"
|
||||
"-DHEADER_FILE=${version_inc}"
|
||||
-P "${generate_vcs_version_script}")
|
||||
if (fake_version_inc)
|
||||
add_custom_command(OUTPUT "${version_inc}" "${fake_version_inc}"
|
||||
DEPENDS "${llvm_vc}" "${generate_vcs_version_script}"
|
||||
COMMAND ${CMAKE_COMMAND} "-DNAMES=LLVM"
|
||||
"-DLLVM_SOURCE_DIR=${llvm_source_dir}"
|
||||
"-DHEADER_FILE=${version_inc}"
|
||||
-P "${generate_vcs_version_script}")
|
||||
else()
|
||||
add_custom_command(OUTPUT "${version_inc}"
|
||||
DEPENDS "${llvm_vc}" "${generate_vcs_version_script}"
|
||||
COMMAND ${CMAKE_COMMAND} "-DNAMES=LLVM"
|
||||
"-DLLVM_SOURCE_DIR=${llvm_source_dir}"
|
||||
"-DHEADER_FILE=${version_inc}"
|
||||
-P "${generate_vcs_version_script}")
|
||||
endif()
|
||||
|
||||
# Mark the generated header as being generated.
|
||||
set_source_files_properties("${version_inc}"
|
||||
PROPERTIES GENERATED TRUE
|
||||
HEADER_FILE_ONLY TRUE)
|
||||
|
||||
add_custom_target(llvm_vcsrevision_h ALL DEPENDS "${version_inc}" "${fake_version_inc}")
|
||||
add_custom_target(llvm_vcsrevision_h ALL DEPENDS "${generated_files}")
|
||||
set_target_properties(llvm_vcsrevision_h PROPERTIES FOLDER "Misc")
|
||||
|
Loading…
Reference in New Issue
Block a user