Commit Graph

2135 Commits

Author SHA1 Message Date
Mario Werner
fee52f79b8 update the includes in the tests to get rid of the deprecated warnings 2016-01-30 22:33:37 +01:00
vitaut
4952e79e45 Document that floating-point formatting is locale-dependent. 2016-01-30 09:20:43 -08:00
vitaut
95c0fb5075 Add a "C" numeric locale 2016-01-29 16:29:46 -08:00
Mario Werner
62ac1d98a4 export the header only library also during installation 2016-01-29 16:57:45 +01:00
Mario Werner
5aa5116edc moved the library definition and the installation into a sub CMakeLists.txt 2016-01-29 16:39:03 +01:00
Mario Werner
5e7ab2f4ea major cleanup of the test folders CMakeLists.txt
The new code does not rely on globally defined include directories
anymore. Additionally a lot of conditional code and has been removed
which improves readability a lot.
2016-01-29 16:21:17 +01:00
Mario Werner
b52d0bd9d4 define cppformat cmake targets with proper interface definitions 2016-01-29 13:23:08 +01:00
Mario Werner
0fb474be3a outlined the compiler feature tests to improve script readability 2016-01-29 13:03:47 +01:00
Mario Werner
3019a8c1fd moved code into cppformat subdirectory
Proxy headers have been placed into the project root to emit
deprecation warnings.
2016-01-29 12:49:35 +01:00
vitaut
7ee287d3d9 Sign extend arguments of smaller types passed to %ll? (#265) 2016-01-27 07:03:19 -08:00
vitaut
ae6368c985 Add a comment to clarify why convert to unsigned 2016-01-26 07:13:34 -08:00
vitaut
bb7a80b1ab Correct comment 2016-01-25 06:46:43 -08:00
vitaut
8474a6232d Don't perform narrowing conversion for integers in printf (#255) 2016-01-24 00:43:42 +01:00
vitaut
22f61140d1 Format CMake files, ignore generated files and don't copy header 2016-01-13 07:14:32 -08:00
Victor Zverovich
52ee516cf3 Merge pull request #264 from niosHD/improve-find-and-package-support
Improve find and package support
2016-01-13 06:37:41 -08:00
Mario Werner
ef7bbfff87 removed workaround for cmake versions prior to 2.8.10 2016-01-13 09:54:02 +01:00
Mario Werner
891e9117f6 trying to update cmake to 2.8.12 in travis via a ppa repo
Whitelist of repos:
https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json

Whitelist of packages:
https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
2016-01-12 16:57:40 +01:00
Mario Werner
3fc3ecd184 reverted removal of CPACK_SOURCE_PACKAGE_FILE_NAME
The use of `CPACK_PACKAGE_NAME` leads to
`cppformat-<version>-Source.zip` as the name for the source package
which is different from the expected `cppformat-<version>.zip`.
2016-01-12 16:48:53 +01:00
vitaut
06f3abe26d Return early from ArgMap::find 2016-01-12 06:37:39 -08:00
Victor Zverovich
50f14f225c Merge pull request #262 from mwinterb/argmap_vector
Changed ArgMap to be backed by a vector instead of a map.
2016-01-12 06:23:19 -08:00
Mario Werner
b732455fd3 enable package support for out of source builds 2016-01-12 12:52:05 +01:00
Mario Werner
daf74ae0b1 upgrades to cmake 2.8.12 and adds config and export support
This commit upgrades cmake to 2.8.12 to implement proper cmake
`find_package` support using config and export file generation.
Having this support enables users to use installed cppformat
with a simple `find_package` call. Directly using a version
from a build directory is also supported.

main.cpp:
```
 #include <cppformat/format.h>
int main(int argc, char** argv)
{
  for(int i = 0; i < argc; ++i)
    fmt::print("{}: {}\n",i,argv[i]);
  return 0;
}

```

CMakeLists.txt:
```
cmake_minimum_required(VERSION 2.8.12)

project(cppformat-test)

find_package(cppformat REQUIRED)

add_executable(cppformat-test "main.cpp")
target_link_libraries(cppformat-test cppformat)

```
Configuring when cppformat is installed under `CMAKE_INSTALL_PREFIX`: `cmake <PATH_TO_TEST_SRC>`

Configuring when cppformat is installed `ELSEWHERE`: `cmake -Dcppformat_DIR=<ELSEWHERE>/lib/cmake/cppformat <PATH_TO_TEST_SRC>`

Configuring when cppformat is only built: `cmake -Dcppformat_DIR=<cppformat_BUILD_DIR> <PATH_TO_TEST_SRC>`
2016-01-12 12:47:19 +01:00
Michael Winterberg
4af764d040 Changed ArgMap to be backed by a vector instead of a map.
The main reason for this is to avoid a dynamic memory allocation in every format() call with Visual Studio if there are no named arguments.
2016-01-10 15:30:34 -08:00
vitaut
97e9ed11bc Set interface include dir for gmock 2016-01-09 08:07:31 -08:00
vitaut
f55bf55d43 Correct comment 2016-01-09 08:06:59 -08:00
vitaut
e604d5347f Fix links in README (#260) 2016-01-08 13:03:34 -08:00
Victor Zverovich
979e70f10d Merge pull request #259 from mwinterb/unknown_pragma_bsr
Fixed unknown pragma warnings for _BitScanReverse.
2016-01-08 07:25:48 -08:00
Michael Winterberg
b203beb61d Don't define the MSVC clz functions unless __builtin_clzll is unavailable.
This is mainly just to avoid including intrin.h unnecessarily.
2016-01-07 15:38:08 -08:00
Michael Winterberg
28a303ddd4 Fixed unknown pragma warnings for _BitScanReverse.
Changed to only define the MSVC implementations for clz and clzll if the builtins are not available to avoid warnings about an unknown #pragma for "intrinsic".
2016-01-06 14:42:27 -08:00
Victor Zverovich
3943803412 Merge pull request #256 from mwinterb/clang_ms_clz
Fixed macro redefinition warnings when compiling with clang-cl.
2016-01-06 06:46:17 -08:00
Michael Winterberg
7185e96da1 Fixed issues with MSVC emulations of clz and clzll.
Both clang-cl and Clang/C2 #define _MSC_VER but also have support for __builtin_clz and __builtin_clzll, leading to duplicate macro definition warnings. Emulation of clz using _BitScanReverse is suppressed if the builtins are already available.

Additionally, the value of the output parameter of _BitScanReverse is undefined if the input value is 0, which is avoided by construction, so the code analysis warning for using uninitialized data is now suppressed.
2016-01-05 16:03:06 -08:00
Michael Winterberg
251a0869be Fixed macro redefinition warnings when compiling with clang-cl.
Both clang-cl and Clang/C2 #define _MSC_VER but also have support for __builtin_clz and __builtin_clzll, leading to duplicate macro definition warnings. This change suppresses emulation of clz using _BitScanReverse if the __clang__ macro is defined.
2016-01-01 18:07:06 -08:00
vitaut
804ad8f4df Document std::ostream overload of fprintf 2015-12-24 07:00:22 -08:00
vitaut
8b0504825d Merge branch 'master' of github.com:cppformat/cppformat 2015-12-24 06:58:05 -08:00
vitaut
77d3761b50 Enable macro expansion in Doxygen (fixes #248) 2015-12-24 06:54:37 -08:00
Victor Zverovich
0525a03a69 Merge pull request #251 from nickhutchinson/work/fprintf-streams
Add fprintf overload that writes to a std::ostream
2015-12-23 06:58:44 -08:00
Nicholas Hutchinson
1a5a1708b7 Add fprintf overload that writes to a std::ostream
For completeness, add an overload for printf that takes a std::ostream.
2015-12-23 15:59:13 +13:00
vitaut
4797ca025e POD -> trivially copyable/constructible 2015-12-20 07:29:59 -08:00
Victor Zverovich
3121ebd044 Merge pull request #249 from dean0x7d/variadic-v3
Reduce compile time of variadic functions (2)
2015-12-20 07:10:00 -08:00
Dean Moldovan
b098306839 Replace template recursion with array initialization 2015-12-19 18:19:18 +01:00
Dean Moldovan
a721319e3a Add MakeArg constructor for Arg 2015-12-19 18:19:18 +01:00
vitaut
29726cefb8 Remove extra '*'s 2015-12-18 07:30:03 -08:00
vitaut
811964502d Add BasicFormatter's members to the docs 2015-12-18 07:24:25 -08:00
vitaut
0629d76bb0 Fallback to sized integer types on MSVC if stdint.h is not available 2015-12-18 07:20:05 -08:00
vitaut
016714c57b Add BasicFormatter to the docs 2015-12-18 07:16:40 -08:00
vitaut
c679352517 Define FMT_API to nothing for Doxygen 2015-12-18 07:13:43 -08:00
vitaut
1042ddda0f Document BasicFormatter 2015-12-18 07:07:41 -08:00
vitaut
d998b5d038 Add version 2.0.0 to the dropdown menu 2015-12-18 06:47:37 -08:00
vitaut
bf6651d1ca Add github-btn style 2015-12-17 07:59:09 -08:00
vitaut
1cba0aea27 Simplify CMake config and do minor adjustments
for consistency with used coding conventions.
2015-12-10 07:24:23 -08:00