Commit Graph

13 Commits

Author SHA1 Message Date
Rune Morling 43556b5d92 cmake: Use GNUInstallDirs (#1818)
* Use GNUInstallDirs instead of hardcoded paths

This change should be a no-op in the normal case and at the same time make it
easier to customise polybar builds on systems with special needs.

* Avoid creating /usr/share/doc/polybar/polybar/*

* Include GNUInstallDirs for the doc target itself

* cmake: Don't try to set CMAKE_INSTALL_* variables

Since we include GNUInstallDirs all these variables are already set

* cmake: Print install directories in summary

* fix(cmake): Make doc-only work like normal build

This is kind of a dirty hack to force CMAKE_INSTALL_DOCDIR to use
`polybar` as the project name when only polybar-doc is built.

Maybe it is wiser at some point to be able to do a doc only build (and
install) that can be done from the top level project. Then we would also
not need to include GNUInstallDirs here
2019-06-24 18:08:59 +02:00
patrick96 9103d232a5 build: Remove -Werror
Whenever a new gcc version is released that introduces new warnings,
this breaks lots of builds on the user's side. This change pushes the
detection of these new warnings a bit back until either a user reports
warnings or developers get the new compiler updates. I think this is a
good tradeoff since release builds are no longer totally broken as soon
as a new compiler version comes out.

Travis still uses -Werror because there we actually want builds to fail.
2019-05-08 12:23:48 +02:00
patrick96 0251a80e75 build: Remove C compiler
There isn't a single .c file in the project. It just added bloat
2019-04-08 09:01:48 +02:00
patrick96 a67b824e25 cmake: Make Release default build type
The polybar executable with RelWithDebInfo gets over 100MB. And there
really isn't any reason to have users install such huge executables.

Release build type gives you approx. 3.6M executables

Fixes #1497
2019-04-08 09:01:48 +02:00
patrick96 9aefbd5d34 build: Add UndefinedBehaviorSanitizer 2019-01-20 15:12:22 +01:00
sam-lunt d3e37918e5 CMake refactor (#1510)
* Clean up CMake logic

- removed logic to find CppUnit (no longer used)
- removed "dirs" variable used to pass include directories
- removed add_library function (no longer used)
- removed make_executable function
    * only used in 2 places (polybar and polybar-msg)
    * it was more general than needed, logic is simpler without it
- split polybar into static library and executable
    * this allows linking unit tests to the library

* rename library

* add coverage build

- Added a CMake build type "Coverage" that builds C and C++
  code with the "--coverage" flag (recognized by both GCC and Clang)
- removed "-Wno-missing-field-initializers" from test flags,
  since it didn't seem to be needed any more
- removed logic from tests/CMakeLists to disable "-Werror" and "-pedantic-errors"
  since there didn't seem to be any warnings during the build

* fix whitespace

* update travis

* remove O2 from defalt flags

* allow tests to be built by default make target

* disable Werror for debug builds
2018-11-21 18:46:33 +01:00
patrick96 b5129ae0c4 refactor(ccache): Enable by default
Following [1] to get to this setup.

We setup all the ccache configuration before calling project() because
project will perform compiler checks. This is also why we can't use
message_colored here and print the colors manually

Before ENABLE_CCACHE was not yet defined when we reached the check in
01-core because the option was defined in 02-opts

[1] https://crascit.com/2016/04/09/using-ccache-with-cmake/
2018-06-01 10:49:00 -07:00
Le Baron d'Merde 55331d17f7 fix(FreeBSD): Use libraries from LOCALBASE (#1111)
Ensures proper linking when not building a port
2018-03-22 00:03:47 +01:00
Kyle Cook 0f34178104 Add FreeBSD Support (#931) 2018-03-21 23:35:10 +01:00
Chase Geigle 299f1617d3 fix(cmake): Suppress -Wnoexcept-type warning on GCC
There is no way to avoid this error in the code itself, so we must
suppress this warning if we wish to keep -Werror.
2017-08-30 15:27:05 +02:00
Dmitry Marakasov b23ff17dde Disable -Werror for parentheses-equality warning
This warning fires here:

/home/travis/build/jaagr/polybar/src/utils/command.cpp:135:46: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
    } else if ((((*(int *) &(m_forkstatus))) == 0xffff)) {
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~

and as this system macro cannot be changed, let's not turn this into an error
2017-07-05 17:17:58 +02:00
Michael Carlberg 41f7f82bd0 fix(cmake): Debug check 2017-01-27 13:30:23 +01:00
Michael Carlberg 43a17c3b36 refactor(cmake): Cleanup 2017-01-26 17:39:50 +01:00