Skip to content

Commit 11a5b80

Browse files
arichardsonGroverkss
authored andcommitted
[libc++] Update CMake dependency for generate_iwyu_mapping.py (llvm#115387)
This script does not depend on the generated headers since those are already special-cased in header_information.py. Change the dependency list to depend on header_information.py instead. While looking at this code also simplify the assignment to libcxx_root inside this script.
1 parent 01e0445 commit 11a5b80

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

libcxx/include/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ endforeach()
10571057
# "include" for dependency tracking.
10581058
add_custom_command(OUTPUT "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp"
10591059
COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_iwyu_mapping.py" "-o" "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp"
1060-
DEPENDS ${_all_includes}
1060+
DEPENDS "${LIBCXX_SOURCE_DIR}/utils/libcxx/header_information.py"
10611061
COMMENT "Generate the mapping file for include-what-you-use"
10621062
)
10631063
list(APPEND _all_includes "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp")

libcxx/include/__cxx03/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ endforeach()
10371037
# "include" for dependency tracking.
10381038
add_custom_command(OUTPUT "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp"
10391039
COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_iwyu_mapping.py" "-o" "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp"
1040-
DEPENDS ${_all_includes}
1040+
DEPENDS "${LIBCXX_SOURCE_DIR}/utils/libcxx/header_information.py"
10411041
COMMENT "Generate the mapping file for include-what-you-use"
10421042
)
10431043
list(APPEND _all_includes "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp")

libcxx/utils/libcxx/header_information.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#
77
# ===----------------------------------------------------------------------===##
88

9-
import os, pathlib, functools
9+
import pathlib, functools
1010

11-
libcxx_root = pathlib.Path(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
11+
libcxx_root = pathlib.Path(__file__).resolve().parent.parent.parent
1212
libcxx_include = libcxx_root / "include"
1313
assert libcxx_root.exists()
1414

0 commit comments

Comments
 (0)