Skip to content

Commit

Permalink
Bazel more bundle include fixes (#1854)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Apr 28, 2024
1 parent 935c19c commit 11f5f09
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion enzyme/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ genrule(
name = "bundled-includes",
srcs = glob(["include/**"]) + ["scripts/bundle-includes.sh"],
outs = ["bundled_includes.h"],
cmd = "$(location :scripts/bundle-includes.sh) ./include $@",
cmd = "$(location :scripts/bundle-includes.sh) $(location :include/enzyme/enzyme) $@"
)


genrule(
name = "gen_enzyme-clang++",
srcs = [":enzyme-clang"],
Expand Down
2 changes: 1 addition & 1 deletion enzyme/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ set(bundled_includes "${CMAKE_CURRENT_BINARY_DIR}/Enzyme/Clang/bundled_includes.
list(APPEND ENZYME_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/bundle-includes.sh)
add_custom_command(OUTPUT ${bundled_includes}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/bundle-includes.sh
${CMAKE_CURRENT_SOURCE_DIR}/include/
${CMAKE_CURRENT_SOURCE_DIR}/include/enzyme/enzyme
${bundled_includes}
DEPENDS ${ENZYME_INCLUDES}
COMMENT "Bundling includes"
Expand Down
4 changes: 3 additions & 1 deletion enzyme/scripts/bundle-includes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

set -e

INPUT_DIR=$1
INPUT_DIR=$(dirname $1)/..
OUTPUT_FILE=$2

echo $INPUT_FILE
echo $OUTPUT_FILE
mkdir -p "$(dirname "$OUTPUT_FILE")"

echo > "$OUTPUT_FILE"
Expand Down

0 comments on commit 11f5f09

Please sign in to comment.