We have a check for windows here anyway, let's move the defines here and we
can drop it in the common header file. And since on Unix HAVE_CONFIG_H is
always defined, we can drop the else condition too.
cmake sets HAVE_DPMS_PROTOTYPES unconditionally to 1 if we have the dpms
headers. So code inside HAVE_X11_EXTENSIONS_DPMS_H never needs to check for
it.
And since there's only one place that cared for this, we can remove the define
in cmake as well.
Many tools strip trailing whitespaces by default, so after editing a file with
whitespace errors we end up with a bunch of unrelated hunks that need to be
reverted locally.
This could be fixed by configuring each tool to not do this (at least for the
barrier repo), or, simpler, we just sed the problem away and make barrier
whitespace-compliant.
sed commands run:
sed -i 's/[ \t]\+$//' **/*.(cpp|h) **/*CMakeLists.txt
Verified with git diff --ignore-space-change, this shows the empty diff.
macdeployqt needs "-executable=filename" to propery
change linking on other variables
also renamed the cmake target from "Barrier_dmg" to
"Barrier_MacOS" to properly reflect earlier changes
Commit 6c888437 made Qt5 mandatory for all builds when it is only
required for the GUI. There's already a find_package call in src/gui,
it just needed the REQUIRED flag to be added.
Sometimes -lpthread is not enough. This has caused build failures on
Gentoo Linux in the past.
The logic also seems needlessly complex. We check for HAVE_PTHREAD on
UNIX platforms even though CMake errors out if pthreads are not
found. Similarly, we have a fallback for HAVE_PTHREAD_SIGNAL being
false even though we always set it to true.
This commit adds suppotr for generating a 'compile commands' JSON
file. This provides fairly sufficient autocomplete support for most text
editors, such as (Neo)vim and VS Code. It specifies include paths, and
the compiler arguments used to compile each source file.
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>