From 61c4976bb5f030c0eb4b5f2d81545b63e85ae20d Mon Sep 17 00:00:00 2001 From: patrick96 Date: Sun, 3 Apr 2022 14:07:23 +0200 Subject: [PATCH] doc: Add getting started for developers --- doc/dev/getting-started.rst | 34 ++++++++++++++++++++++++++++++++++ doc/index.rst | 1 + 2 files changed, 35 insertions(+) create mode 100644 doc/dev/getting-started.rst diff --git a/doc/dev/getting-started.rst b/doc/dev/getting-started.rst new file mode 100644 index 00000000..0ce7ccfa --- /dev/null +++ b/doc/dev/getting-started.rst @@ -0,0 +1,34 @@ +Getting Started +=============== + +Setting up polybar for development is basically the same process as `compiling +it from source `_. +However, we recommend using the ``Debug`` or ``Sanitize`` cmake build type when +configuring the project: + +.. code-block:: shell + + cmake -DCMAKE_BUILD_TYPE=Debug .. + # Or + cmake -DCMAKE_BUILD_TYPE=Sanitize .. + +This will give you debug symbols in the executable and the ``Sanitize`` build +type will also enable the ``AddressSanitizer`` and +``UndefinedBehaviorSanitizer``, which can give you very useful information +about crashes and undefined behavior at runtime. + +Editors +------- + +Since this is a cmake project, most IDEs will have built-in support or a plugin +to automatically setup this project. + +In addition, the ``cmake`` command creates a ``compile_commands.json`` file in +the build folder, which can be used by many `language servers +`_. +If you are using a C++ language server in your editor, it should be as easy as +symlinking the ``compile_commands.json`` into the repo root directory: + +.. code-block:: shell + + ln -s build/compile_commands.json . diff --git a/doc/index.rst b/doc/index.rst index 13ba749a..d6e27cc3 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -33,6 +33,7 @@ Welcome to the official polybar documentation. :maxdepth: 1 :caption: Developer Documentation: + dev/getting-started dev/style-guide dev/testing dev/release-workflow