From b3ac70b2bd77cb805c3ddd1920971c8313d82376 Mon Sep 17 00:00:00 2001 From: "A. R. Shajii" Date: Sun, 10 Oct 2021 14:41:10 -0400 Subject: [PATCH] Collect headers in build --- .github/actions/build-manylinux/entrypoint.sh | 1 + .github/workflows/ci.yml | 1 + CMakeLists.txt | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/.github/actions/build-manylinux/entrypoint.sh b/.github/actions/build-manylinux/entrypoint.sh index 4d80ae8b..44cf02e5 100755 --- a/.github/actions/build-manylinux/entrypoint.sh +++ b/.github/actions/build-manylinux/entrypoint.sh @@ -38,6 +38,7 @@ mkdir -p codon-deploy/bin codon-deploy/lib/codon cp build/codon codon-deploy/bin/ cp build/libcodon*.so codon-deploy/lib/codon/ cp build/libomp.so codon-deploy/lib/codon/ +cp -r build/include codon-deploy/ cp -r stdlib codon-deploy/lib/codon/ tar -czf ${CODON_BUILD_ARCHIVE} codon-deploy du -sh codon-deploy diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8bfc16e5..451a6bd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,6 +188,7 @@ jobs: cp build/codon codon-deploy/bin/ cp build/libcodon*.${LIBEXT} codon-deploy/lib/codon/ cp build/libomp.${LIBEXT} codon-deploy/lib/codon/ + cp -r build/include codon-deploy/ cp -r stdlib codon-deploy/lib/codon/ tar -czf ${CODON_BUILD_ARCHIVE} codon-deploy du -sh codon-deploy diff --git a/CMakeLists.txt b/CMakeLists.txt index b2e76732..69f06472 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -280,6 +280,25 @@ else() target_link_libraries(codonc PRIVATE ${STATIC_LIBCPP} ${LLVM_LIBS} dl codonrt) endif() +# Gather headers +add_custom_target( + headers + ALL + COMMENT "Collecting headers" + BYPRODUCTS "${CMAKE_BINARY_DIR}/include" + VERBATIM + COMMAND ${CMAKE_COMMAND} -E make_directory + "${CMAKE_BINARY_DIR}/include/codon/compiler" + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CMAKE_SOURCE_DIR}/compiler" "${CMAKE_BINARY_DIR}/include/codon/compiler" + COMMAND ${CMAKE_COMMAND} -E make_directory + "${CMAKE_BINARY_DIR}/include/codon/runtime" + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CMAKE_SOURCE_DIR}/runtime" "${CMAKE_BINARY_DIR}/include/codon/runtime" + COMMAND find "${CMAKE_BINARY_DIR}/include" -type f ! -name "*.h" -exec rm {} \\; +) +add_dependencies(headers codonrt codonc) + # Codon command-line tool add_executable(codon runtime/main.cpp) target_link_libraries(codon ${STATIC_LIBCPP} codonc Threads::Threads)