summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--CONTRIBUTING.md31
-rw-r--r--src/CMakeLists.txt34
-rw-r--r--test/regress/1057.test2
-rwxr-xr-xtools/nix-build.sh20
5 files changed, 70 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f5da6a04..f8dbd892 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -298,9 +298,8 @@ configure_file(
${PROJECT_SOURCE_DIR}/src/system.hh.in
${PROJECT_BINARY_DIR}/system.hh)
-if (CMAKE_CXX_COMPILER MATCHES "clang")
- set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
-elseif(CMAKE_CXX_COMPILER MATCHES "g\\+\\+")
+if((CMAKE_CXX_COMPILER MATCHES "clang") OR
+ (CMAKE_CXX_COMPILER MATCHES "clang\\+\\+"))
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
endif()
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e810e7df..79e97296 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,9 +1,9 @@
Tips for contributors
---------------------
-* Please **make pull requests against `next`, not `master`**.
- Ledger follows a [git-flow] branching model,
- in which development happens on the `next` branch and is subsequently merged into `master` for releases.
+* Please **make pull requests against `next`, not `master`**. Ledger follows
+ a [git-flow] branching model, in which development happens on the `next`
+ branch and is subsequently merged into `master` for releases.
* If you're making **changes to files for which the Travis build is not
relevant**, please **add `[ci skip]` to the end of the commit message**.
* Report bugs using [Bugzilla]. If you want, you can access the bug system using the lite (free) version of [Deskzilla].
@@ -92,6 +92,31 @@ orientation:
**./tools/**: an accretion of tools, mostly small scripts, to aid development
+Building
+---
+
+If you are going to be working on Ledger, you'll want to enable both debug
+builds (which are the default, using `acprep`), and also the use of
+pre-compiled headers. To do this, specify your compiler as either `clang++`
+or `g++` as follows:
+
+ mkdir build
+ ./acprep --compiler=clang++
+ cd build
+ make
+
+This will set up a debug build using clang++ (and pre-compiled headers, which
+is enabled by the combination of those two), and then start a build.
+
+For even quicker rebuilds, try the Ninja build tool, which is very fast at
+determining what to rebuild, and automatically takes advantage of multiple
+cores:
+
+ mkdir build
+ ./acprep --compiler=clang++ --ninja
+ cd build
+ ninja
+
[Boost]: http://boost.org
[Boost.Python]: http://www.boost.org/libs/python/
[Bugzilla]: http://bugs.ledger-cli.org/
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 65e58edb..71d9478a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -138,20 +138,24 @@ set(LEDGER_INCLUDES
${PROJECT_BINARY_DIR}/system.hh)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
- if ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER MATCHES "cxx"))
+ if (CMAKE_CXX_COMPILER MATCHES "clang\\+\\+")
add_definitions(
- -Weverything
- -Wno-disabled-macro-expansion
- -Wno-padded
- -Wno-weak-vtables
- -Wno-exit-time-destructors
- -Wno-global-constructors
- -Wno-switch-enum
- -Wno-missing-prototypes
- -Wno-missing-noreturn
- -Wno-unused-parameter
- -Wno-c++98-compat
- -fno-limit-debug-info)
+ # -Weverything
+ # -Wno-disabled-macro-expansion
+ # -Wno-padded
+ # -Wno-weak-vtables
+ # -Wno-exit-time-destructors
+ # -Wno-global-constructors
+ # -Wno-switch-enum
+ # -Wno-missing-prototypes
+ # -Wno-missing-noreturn
+ # -Wno-unused-parameter
+ # -Wno-c++98-compat
+ # -fno-limit-debug-info
+ -Wno-\#pragma-messages
+ -Wno-unused-local-typedef
+ --system-header-prefix=include/boost/
+ --system-header-prefix=boost/)
macro(ADD_PCH_RULE _header_filename _src_list _other_srcs)
set(_pch_filename "${_header_filename}.pch")
@@ -189,7 +193,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
DEPENDS ${_header_filename})
endmacro(ADD_PCH_RULE _header_filename _src_list _other_srcs)
- elseif(CMAKE_CXX_COMPILER MATCHES "g\\+\\+")
+ elseif (CMAKE_CXX_COMPILER MATCHES "g\\+\\+")
set(GXX_WARNING_FLAGS
-pedantic
-Wall
@@ -237,7 +241,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
get_directory_property(DIRINC INCLUDE_DIRECTORIES)
foreach(_inc ${DIRINC})
- list(APPEND _args "-isystem " ${_inc})
+ list(APPEND _args "-I" ${_inc})
endforeach(_inc ${DIRINC})
separate_arguments(_args)
diff --git a/test/regress/1057.test b/test/regress/1057.test
index 1cd91ee7..07eb2dbf 100644
--- a/test/regress/1057.test
+++ b/test/regress/1057.test
@@ -3,7 +3,7 @@
Dépense:Maison:Service:Poste
* Passif:Crédit:BanqueAccord -171,63 €
-test -f test/regress/1057.test --now=2014/06/27 emacs
+test --now=2014/06/27 emacs
(("$sourcepath/test/regress/1057.test" 1 (21308 60112 0) nil "www.amazon.fr"
(2 "Dépense:Loisir:Ordi:Matériel" "101,50 €" nil " disque dur portable 2,5\" 2000 Go")
(3 "Dépense:Maison:Service:Poste" "70,13 €" nil)
diff --git a/tools/nix-build.sh b/tools/nix-build.sh
new file mode 100755
index 00000000..4712dbea
--- /dev/null
+++ b/tools/nix-build.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+flavor=$1
+shift 1
+
+JOBS=-j$(sysctl -n hw.activecpu)
+
+OPTIONS="$flavor --debug --python --ninja $JOBS"
+#OPTIONS="$flavor --debug --python --ninja --doxygen $JOBS"
+
+time nice -n 20 nix-shell -p \
+ cmake boost gmp mpfr libedit python texinfo gnused \
+ ninja doxygen \
+ --command "./acprep $OPTIONS make $JOBS $@" && \
+
+time nice -n 20 nix-shell -p \
+ cmake boost gmp mpfr libedit python texinfo gnused \
+ ninja doxygen \
+ --command "./acprep $OPTIONS check $JOBS $@" \
+ \