[clang-tools-extra] [clang-doc] fix path bug introduced by asset test (PR #97540)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 3 01:45:41 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tools-extra

Author: None (PeterChou1)

<details>
<summary>Changes</summary>

Fixes https://github.com/llvm/llvm-project/issues/97507

this patch fixes the bug by copying assets to the correct repository for windows builds

---
Full diff: https://github.com/llvm/llvm-project/pull/97540.diff


1 Files Affected:

- (modified) clang-tools-extra/clang-doc/tool/CMakeLists.txt (+6-2) 


``````````diff
diff --git a/clang-tools-extra/clang-doc/tool/CMakeLists.txt b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
index e93a5728d6b6b..3fd41f187a617 100644
--- a/clang-tools-extra/clang-doc/tool/CMakeLists.txt
+++ b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
@@ -25,7 +25,11 @@ set(assets
 )
 
 set(asset_dir "${CMAKE_CURRENT_SOURCE_DIR}/../assets")
-set(resource_dir "${CMAKE_BINARY_DIR}/share/clang-doc")
+if(MSVC)
+  set(resource_dir "${CMAKE_BINARY_DIR}/$<CONFIG>/share/clang-doc")
+else()
+  set(resource_dir "${CMAKE_BINARY_DIR}/share/clang-doc")
+endif()
 set(out_files)
 
 function(copy_files_to_dst src_dir dst_dir file)
@@ -52,4 +56,4 @@ add_custom_target(copy-clang-doc-assets
   COMMENT "Copying Clang-Doc Assets"
 )
 set_target_properties(copy-clang-doc-assets PROPERTIES FOLDER "Clang-Doc/Assets")
-add_dependencies(clang-doc copy-clang-doc-assets)
+add_dependencies(clang-doc copy-clang-doc-assets)
\ No newline at end of file

``````````

</details>


https://github.com/llvm/llvm-project/pull/97540


More information about the cfe-commits mailing list