From 73a3c24394621f31a59e6b1235dc5fd28f78d3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Lind=C3=A9n?= Date: Thu, 11 Feb 2021 00:45:42 +0100 Subject: [PATCH] Build with -Wmissing-declarations (#71) This flag is used to find global functions defined without a previous declaration. Usually it spots accidental globals, but in this case it was just missing headers. --- CMakeLists.txt | 1 + src/ftxui/dom/separator.cpp | 1 + src/ftxui/dom/text.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12aa920..57efcf4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,6 +142,7 @@ foreach(lib screen dom component) target_compile_options(${lib} PRIVATE "-Wextra") target_compile_options(${lib} PRIVATE "-pedantic") target_compile_options(${lib} PRIVATE "-Werror") + target_compile_options(${lib} PRIVATE "-Wmissing-declarations") target_compile_options(${lib} PRIVATE "-Wno-sign-compare") endif() diff --git a/src/ftxui/dom/separator.cpp b/src/ftxui/dom/separator.cpp index a95701c..0997d6e 100644 --- a/src/ftxui/dom/separator.cpp +++ b/src/ftxui/dom/separator.cpp @@ -1,3 +1,4 @@ +#include "ftxui/dom/elements.hpp" #include "ftxui/dom/node.hpp" namespace ftxui { diff --git a/src/ftxui/dom/text.cpp b/src/ftxui/dom/text.cpp index 53c3b8b..0a30f7d 100644 --- a/src/ftxui/dom/text.cpp +++ b/src/ftxui/dom/text.cpp @@ -1,4 +1,5 @@ #include +#include "ftxui/dom/elements.hpp" #include "ftxui/dom/node.hpp" #include "ftxui/screen/string.hpp"