From 03917439a1ddcf202e9fc53937b10eeb7ec0a99a Mon Sep 17 00:00:00 2001 From: gramanas Date: Thu, 27 Sep 2018 12:36:54 +0300 Subject: Update CMakeLists and build istructions --- README.org | 62 +++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 23 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 757b991..aa2ebae 100644 --- a/README.org +++ b/README.org @@ -10,38 +10,54 @@ - sqlite3-dev ** compiler -By default I use clang, if you want to use gcc just -edit the =CMakeLists.txt= file and change =clang= to =gcc= +#+BEGIN_SRC sh + > export CC=clang + # or + > export CC=gcc +#+END_SRC ** make #+BEGIN_SRC sh -# clone the repo -> cd ~/code; git clone https://gitlab.com/grm-grm/ck -# make a build directory and enter it -> mkdir ~/ck_build; cd ~/ck_build; -# run cmake -> cmake ~/code/ck -# run make -> make -# run ck -> ./ck + # clone the repo + > cd ~/code; git clone https://gitlab.com/grm-grm/ck + # make a build directory and enter it + > mkdir ~/ck_build; cd ~/ck_build; + # run cmake + > cmake ~/code/ck + # run make + > make + # run ck + > ./ck #+END_SRC * for devs -** make +** CMake options +cmake accepts the following options: +#+BEGIN_SRC cmake + option(CK_ASAN "Build with asan") + option(CK_DEBUG "Build with debug symbols") + option(CK_TESTS "Make the tests") + option(CK_SHARED "Build with shared lib") +#+END_SRC + +To use any one of them append it after the cmake command like so: +#+BEGIN_SRC sh + cmake -DCK_ASAN=1 -DCK_DEBUG=1 -DCK_TESTS=1 ~/code/ck +#+END_SRC + Just build with address sanitizer enabled like so: llvm has better asan than gcc, so I use that. #+BEGIN_SRC sh -# clone the repo -> cd ~/code; git clone https://gitlab.com/grm-grm/ck -# make a build directory and enter it -> mkdir ~/ck_build; cd ~/ck_build; -# run cmake -> cmake ~/code/ck -DCK_ASAN=ON -# run make -> make -# run ck -> ./ck + # clone the repo + > cd ~/code; git clone https://gitlab.com/grm-grm/ck + # make a build directory and enter it + > mkdir ~/ck_build; cd ~/ck_build; + # run cmake + > cmake -DCK_ASAN=1 -DCK_DEBUG=1 -DCK_TESTS=1 ~/code/ck + # run make + > make + # run ck + > ./ck #+END_SRC ** tests -- cgit v1.2.3