From bdd501c01a016a351a0e32648cbcb8a7a5827caa Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 13 Dec 2024 23:12:35 +0100 Subject: [PATCH] chore: Make sysroot and resource headers relative to the cli binary Signed-off-by: Roberto Raggi --- src/frontend/CMakeLists.txt | 14 ++++++++++++++ src/lib/CMakeLists.txt | 3 --- src/lib/cxx/CMakeLists.txt | 5 +---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/frontend/CMakeLists.txt b/src/frontend/CMakeLists.txt index 5fb33bfa..242c8698 100644 --- a/src/frontend/CMakeLists.txt +++ b/src/frontend/CMakeLists.txt @@ -54,3 +54,17 @@ if (CXX_INSTALL_TOOLS) EXPORT cxxTargets ) endif() + +add_custom_target(link_cxx_include ALL + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../lib/cxx/include $/../lib/cxx/include +) + +add_custom_command( + OUTPUT wasi-sysroot.timestamp + COMMAND ${CMAKE_COMMAND} -E copy_directory ${wasi_sysroot_SOURCE_DIR} $/../lib/wasi-sysroot + COMMAND ${CMAKE_COMMAND} -E touch wasi-sysroot.timestamp +) + +add_custom_target(link_wasi_sysroot ALL + DEPENDS wasi-sysroot.timestamp +) diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index f5211708..41e25d16 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -17,9 +17,6 @@ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -add_custom_target(link_wasi_sysroot ALL - COMMAND ${CMAKE_COMMAND} -E copy_directory ${wasi_sysroot_SOURCE_DIR} wasi-sysroot) - add_subdirectory(cxx) if (CXX_INSTALL_WASI_SYSROOT) diff --git a/src/lib/cxx/CMakeLists.txt b/src/lib/cxx/CMakeLists.txt index b0e8591a..b18d0ac4 100644 --- a/src/lib/cxx/CMakeLists.txt +++ b/src/lib/cxx/CMakeLists.txt @@ -17,12 +17,9 @@ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -add_custom_target(link_cxx_include ALL - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include include) - file(GLOB_RECURSE HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/*") install( FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/cxx/include -) \ No newline at end of file +)