This kinda feels like a repeat of https://bugzilla.redhat.com/show_bug.cgi?id=2215937. Integrating iwyu into a CMake build system using CMAKE_C_INCLUDE_WHAT_YOU_USE and CMAKE_CXX_INCLUDE_WHAT_YOU_USE does not produce output. The same steps work on Fedora 38. There are 2 test files needed to reproduce this: `main.cpp` and `CMakeLists.txt`. main.cpp: ```c++ #include <iostream> #include <cstdio> int main() { std::cout << "Hello, World!" << std::endl; return 0; } ``` CMakeLists.txt: ```cmake cmake_minimum_required(VERSION 3.22) project(iwyu_test) set(CMAKE_CXX_STANDARD 17) add_executable(iwyu_test main.cpp) ``` Reproducible: Always Steps to Reproduce: 1. Fresh install Fedora 39 with the "C Development Tools and Libraries" group selected. 2. Update all packages: sudo dnf upgrade --refresh 3. Install required packages: sudo dnf install cmake iwyu 4. Put test files `main.cpp` and `CMakeLists.txt` into the same directory. 5. Configure CMake: cmake -B build -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=include-what-you-use -DCMAKE_C_INCLUDE_WHAT_YOU_USE=include-what-you-use -DCMAKE_BUILD_TYPE=RelWithDebInfo 6. Start the build: cd build && cmake --build . Actual Results: Build succeeds but there is no iwyu output. Expected Results: ``` Warning: include-what-you-use reported diagnostics: /home/f38-test/iwyu-test/main.cpp should add these lines: /home/f38-test/iwyu-test/main.cpp should remove these lines: - #include <cstdio> // lines 3-3 The full include-list for /home/f38-test/iwyu-test/main.cpp: #include <iostream> // for char_traits, operator<<, basic_ostream, endl, cout --- ```
Good catch. Thank you. I forgot to rebase F39 branch to version 0.21 with LLVM 17 support. It will be fixed shortly. Please test this update and give it positive karma.
FEDORA-2024-c4396f7682 (iwyu-0.21-1.fc39) has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2024-c4396f7682
FEDORA-2024-c4396f7682 (iwyu-0.21-1.fc39) has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report.