[clang-tools-extra] [llvm] [clang-doc] fix bug introduced by asset test (PR #97540)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 3 15:48:04 PDT 2024
https://github.com/PeterChou1 updated https://github.com/llvm/llvm-project/pull/97540
>From b8dd4f6f2005d2e08ae13023905d0f36edd6348b Mon Sep 17 00:00:00 2001
From: PeterChou1 <peter.chou at mail.utoronto.ca>
Date: Wed, 3 Jul 2024 04:42:33 -0400
Subject: [PATCH 1/6] [clang-doc] fix path bug introduced by asset test
---
clang-tools-extra/clang-doc/tool/CMakeLists.txt | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
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
>From cf993cfeeab18be6aa434e159fb625456183d4da Mon Sep 17 00:00:00 2001
From: PeterChou1 <peter.chou at mail.utoronto.ca>
Date: Wed, 3 Jul 2024 13:49:26 -0400
Subject: [PATCH 2/6] [clang-doc] modify cmake file to fix asset install path
---
clang-tools-extra/clang-doc/tool/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang-tools-extra/clang-doc/tool/CMakeLists.txt b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
index 3fd41f187a617..ddaf8cd4cdbd6 100644
--- a/clang-tools-extra/clang-doc/tool/CMakeLists.txt
+++ b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
@@ -25,7 +25,7 @@ set(assets
)
set(asset_dir "${CMAKE_CURRENT_SOURCE_DIR}/../assets")
-if(MSVC)
+if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
set(resource_dir "${CMAKE_BINARY_DIR}/$<CONFIG>/share/clang-doc")
else()
set(resource_dir "${CMAKE_BINARY_DIR}/share/clang-doc")
>From e389b78848127be9753797d355d196c03e3974fd Mon Sep 17 00:00:00 2001
From: PeterChou1 <peter.chou at mail.utoronto.ca>
Date: Wed, 3 Jul 2024 14:14:56 -0400
Subject: [PATCH 3/6] [clang-doc] fix nit
---
clang-tools-extra/clang-doc/tool/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang-tools-extra/clang-doc/tool/CMakeLists.txt b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
index ddaf8cd4cdbd6..aaf3c3b8734c8 100644
--- a/clang-tools-extra/clang-doc/tool/CMakeLists.txt
+++ b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
@@ -56,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)
\ No newline at end of file
+add_dependencies(clang-doc copy-clang-doc-assets)
>From 4733341a26ef3b6faa1a00d2e53b0033de440eb7 Mon Sep 17 00:00:00 2001
From: PeterChou1 <peter.chou at mail.utoronto.ca>
Date: Wed, 3 Jul 2024 16:04:37 -0400
Subject: [PATCH 4/6] [llvm] modify cmake list to add shared directory
---
clang-tools-extra/clang-doc/tool/CMakeLists.txt | 7 +------
llvm/CMakeLists.txt | 6 ++++++
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/clang-tools-extra/clang-doc/tool/CMakeLists.txt b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
index aaf3c3b8734c8..c908cac9ce2a5 100644
--- a/clang-tools-extra/clang-doc/tool/CMakeLists.txt
+++ b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
@@ -25,11 +25,6 @@ set(assets
)
set(asset_dir "${CMAKE_CURRENT_SOURCE_DIR}/../assets")
-if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
- 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)
@@ -48,7 +43,7 @@ foreach(f ${assets})
install(FILES ${asset_dir}/${f}
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang-doc"
COMPONENT clang-doc)
- copy_files_to_dst(${asset_dir} ${resource_dir} ${f})
+ copy_files_to_dst(${asset_dir} ${LLVM_SHARE_DIR} ${f})
endforeach(f)
add_custom_target(copy-clang-doc-assets
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 91a2b6181ce0a..0c02498aa6fce 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -452,6 +452,12 @@ if(WIN32 OR CYGWIN)
else()
set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
endif()
+# set shared directory
+if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ set(LLVM_SHARE_DIR "${CMAKE_BINARY_DIR}/$<CONFIG>/share")
+else()
+ set(LLVM_SHARE_DIR "${CMAKE_BINARY_DIR}/share")
+endif()
# Each of them corresponds to llvm-config's.
set(LLVM_TOOLS_BINARY_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) # --bindir
>From 3433bfecffe25077fc1749be6c30512e2e47eadb Mon Sep 17 00:00:00 2001
From: PeterChou1 <peter.chou at mail.utoronto.ca>
Date: Wed, 3 Jul 2024 16:08:29 -0400
Subject: [PATCH 5/6] [clang-doc] readd resource directory
---
clang-tools-extra/clang-doc/tool/CMakeLists.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/clang-tools-extra/clang-doc/tool/CMakeLists.txt b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
index c908cac9ce2a5..b88b51ce0d74a 100644
--- a/clang-tools-extra/clang-doc/tool/CMakeLists.txt
+++ b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
@@ -25,6 +25,7 @@ set(assets
)
set(asset_dir "${CMAKE_CURRENT_SOURCE_DIR}/../assets")
+set(resource_dir "${LLVM_SHARE_DIR}/clang-doc")
set(out_files)
function(copy_files_to_dst src_dir dst_dir file)
@@ -43,7 +44,7 @@ foreach(f ${assets})
install(FILES ${asset_dir}/${f}
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang-doc"
COMPONENT clang-doc)
- copy_files_to_dst(${asset_dir} ${LLVM_SHARE_DIR} ${f})
+ copy_files_to_dst(${asset_dir} ${resource_dir} ${f})
endforeach(f)
add_custom_target(copy-clang-doc-assets
>From 8819740121bfe25ad2b1e5ed48c2984477eeff19 Mon Sep 17 00:00:00 2001
From: PeterChou1 <peter.chou at mail.utoronto.ca>
Date: Wed, 3 Jul 2024 18:47:44 -0400
Subject: [PATCH 6/6] [clang-doc] use LLVM_RUNTIME_OUTPUT_INTDIR
---
clang-tools-extra/clang-doc/tool/CMakeLists.txt | 2 +-
llvm/CMakeLists.txt | 10 ++--------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/clang-tools-extra/clang-doc/tool/CMakeLists.txt b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
index b88b51ce0d74a..601a0460d76b3 100644
--- a/clang-tools-extra/clang-doc/tool/CMakeLists.txt
+++ b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
@@ -25,7 +25,7 @@ set(assets
)
set(asset_dir "${CMAKE_CURRENT_SOURCE_DIR}/../assets")
-set(resource_dir "${LLVM_SHARE_DIR}/clang-doc")
+set(resource_dir "${LLVM_RUNTIME_OUTPUT_INTDIR}/../share/clang-doc")
set(out_files)
function(copy_files_to_dst src_dir dst_dir file)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 0c02498aa6fce..33d5190a05389 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -452,12 +452,6 @@ if(WIN32 OR CYGWIN)
else()
set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
endif()
-# set shared directory
-if(CMAKE_GENERATOR MATCHES "Visual Studio")
- set(LLVM_SHARE_DIR "${CMAKE_BINARY_DIR}/$<CONFIG>/share")
-else()
- set(LLVM_SHARE_DIR "${CMAKE_BINARY_DIR}/share")
-endif()
# Each of them corresponds to llvm-config's.
set(LLVM_TOOLS_BINARY_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) # --bindir
@@ -578,11 +572,11 @@ option(LLVM_ENABLE_Z3_SOLVER
)
if (LLVM_ENABLE_Z3_SOLVER)
- find_package(Z3 4.8.9)
+ find_package(Z3 4.7.1)
if (LLVM_Z3_INSTALL_DIR)
if (NOT Z3_FOUND)
- message(FATAL_ERROR "Z3 >= 4.8.9 has not been found in LLVM_Z3_INSTALL_DIR: ${LLVM_Z3_INSTALL_DIR}.")
+ message(FATAL_ERROR "Z3 >= 4.7.1 has not been found in LLVM_Z3_INSTALL_DIR: ${LLVM_Z3_INSTALL_DIR}.")
endif()
endif()
More information about the cfe-commits
mailing list