Skip to content

Commit

Permalink
chore: Make sysroot and resource headers relative to the cli binary
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Raggi <[email protected]>
  • Loading branch information
robertoraggi committed Dec 13, 2024
1 parent ccabd01 commit bdd501c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
14 changes: 14 additions & 0 deletions src/frontend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_FILE_DIR:cxx>/../lib/cxx/include
)

add_custom_command(
OUTPUT wasi-sysroot.timestamp
COMMAND ${CMAKE_COMMAND} -E copy_directory ${wasi_sysroot_SOURCE_DIR} $<TARGET_FILE_DIR:cxx>/../lib/wasi-sysroot
COMMAND ${CMAKE_COMMAND} -E touch wasi-sysroot.timestamp
)

add_custom_target(link_wasi_sysroot ALL
DEPENDS wasi-sysroot.timestamp
)
3 changes: 0 additions & 3 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions src/lib/cxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
)

0 comments on commit bdd501c

Please sign in to comment.