-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add support for iwyu on nix * cleanup headers based on iwyu tool * fix a couple of compiler warnings * tidy
- Loading branch information
Showing
39 changed files
with
156 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ pkgs ? import <nixpkgs> { } | ||
}: | ||
let | ||
# Workaround taken from https://github.com/NixOS/nixpkgs/issues/189753 | ||
# | ||
# To use the tool extend your cmake settings: | ||
# "cmake.configureSettings": { | ||
# "CMAKE_CXX_INCLUDE_WHAT_YOU_USE": [ | ||
# "include-what-you-use", | ||
# "-Xiwyu", | ||
# "--mapping_file=${workspaceFolder}/misc/mappings/iwyu_nix.imp", | ||
# "-Xiwyu", | ||
# "--no_fwd_decls", | ||
# ] | ||
# }, | ||
# | ||
include-what-you-use-wrapped = | ||
let | ||
llvm = pkgs.llvmPackages_15; | ||
in | ||
pkgs.wrapCCWith rec { | ||
cc = pkgs.include-what-you-use.override { | ||
llvmPackages = llvm; | ||
}; | ||
extraBuildCommands = '' | ||
wrap include-what-you-use $wrapper $ccPath/include-what-you-use | ||
substituteInPlace "$out/bin/include-what-you-use" --replace 'dontLink=0' 'dontLink=1' | ||
substituteInPlace "$out/bin/include-what-you-use" --replace ' && isCxx=1 || isCxx=0' '&& true; isCxx=1' | ||
rsrc="$out/resource-root" | ||
mkdir "$rsrc" | ||
ln -s "${llvm.clang}/resource-root/include" "$rsrc" | ||
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags | ||
''; | ||
libcxx = llvm.libcxx; | ||
}; | ||
in | ||
pkgs.mkShell { | ||
buildInputs = with pkgs; [ | ||
cmake | ||
ninja | ||
pkg-config | ||
opencv | ||
SDL2 | ||
catch2_3 | ||
spdlog | ||
exiv2 | ||
dbus | ||
(python3.withPackages (pkgs: with pkgs; [ pyyaml ])) | ||
clang-tools_15 | ||
include-what-you-use-wrapped | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[ | ||
{ include: ["@<__algorithm/.*>", "private", "<algorithm>", "public"] }, | ||
{ include: ["@<__functional/.*>", "private", "<functional>", "public"] }, | ||
{ include: ["@<__type_traits/.*>", "private", "<type_traits>", "public"] }, | ||
{ include: ["@<__memory/.*>", "private", "<memory>", "public"] }, | ||
{ include: ["@<__iterator/.*>", "private", "<iterator>", "public"] }, | ||
{ include: ["@<__filesystem/.*>", "private", "<filesystem>", "public"] }, | ||
{ include: ["@<__numeric/.*>", "private", "<numeric>", "public"] }, | ||
{ include: ["@<__utility/.*>", "private", "<utility>", "public"] }, | ||
{ include: ["@<__chrono/.*>", "private", "<chrono>", "public"] }, | ||
{ include: ["@<__concepts/.*>", "private", "<concepts>", "public"] }, | ||
{ include: ["@<opencv2/core/.*>", "private", "<opencv2/core.hpp>", "public"] }, | ||
{ include: ["@<opencv2/stitching/.*>", "private", "<opencv2/stitching.hpp>", "public"] }, | ||
{ symbol: [ "std::string", private, "<string>", public ] }, | ||
{ symbol: [ "std::abs", private, "<cmath>", public ] }, | ||
{ symbol: [ "std::ssize", private, "<vector>", public ] }, | ||
{ include: ["@<fmt/.*>", "private", "<spdlog/fmt/fmt.h>", "public"] }, | ||
{ include: ["<__errc>", "private", "<system_error>", "public"] }, | ||
{ include: ["<__mutex_base>", "private", "<mutex>", "public"] }, | ||
{ include: ["@<alpaca/detail/.*>", "private", "<alpaca/alpaca.h>", "public"] }, | ||
{ include: ["<exiv2/exif.hpp>", "private", "<exiv2/exiv2.hpp>", "public"] }, | ||
{ include: ["<exiv2/image.hpp>", "private", "<exiv2/exiv2.hpp>", "public"] }, | ||
{ include: ["<exiv2/tags.hpp>", "private", "<exiv2/exiv2.hpp>", "public"] }, | ||
{ include: ["<exiv2/types.hpp>", "private", "<exiv2/exiv2.hpp>", "public"] }, | ||
{ include: ["<exiv2/error.hpp>", "private", "<exiv2/exiv2.hpp>", "public"] }, | ||
{ include: ["<__fwd/string_view.h>", "private", "<string_view>", "public"] }, | ||
{ include: ["@<SDL_.*>", "private", "<SDL.h>", "public"] }, | ||
{ include: ["<spdlog/common.h>", "private", "<spdlog/spdlog.h>", "public"] }, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
clang-format-15 -i `find xpano -name *.cc -or -name *.h` | ||
clang-format-15 -i `find tests -name *.cc -or -name *.h` | ||
clang-format-15 -i `find tests -name *.cc -or -name *.h` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
#pragma once | ||
|
||
#include <filesystem> | ||
#include <optional> | ||
#include <string> | ||
#include <vector> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
#include <future> | ||
#include <optional> | ||
#include <string> | ||
|
||
#include "xpano/utils/text.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.