Commit Graph

1963 Commits

Author SHA1 Message Date
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
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
Victor Zverovich
a9d2e826fe Merge pull request #245 from macdems/master
Declarations for shared library in Windows.
2015-12-10 07:05:33 -08:00
Maciej Dems
c47318afa8 Declarations for shared library in Windows.
Added __declspec(dllimport) and __declspec(dllexport) declarations
when compiled in Windows.
2015-12-10 13:36:18 +01:00
vitaut
ecd52bc610 Fix for a bogus MSVC warning (#244) 2015-12-09 08:57:29 -08:00
vitaut
5c76d107cb Fix MSVC build 2015-12-06 14:17:34 -08:00
vitaut
98c1f76f24 Replace uninitialized_copy with memmove (#242)
because the memory areas may overlap.
2015-12-06 07:44:07 -08:00
vitaut
e7f4566dd4 Replace <algorithm> with <memory>
~20% faster compile time on bloat-test
2015-12-04 22:57:36 -08:00
vitaut
e0179ee190 Fix a warning and remove extra newline 2015-12-04 17:52:36 -08:00
vitaut
e567fe6960 Replace "!!" with "!= 0" for readability 2015-12-04 17:52:06 -08:00
vitaut
7c60db1e24 Fix a warning 2015-12-04 14:12:42 -08:00
vitaut
0ea73df717 Merge branch 'custom-formatter' 2015-12-04 07:24:09 -08:00
vitaut
aa7bb101ed Undefine fileno if defined in posix-test 2015-12-03 20:17:04 -08:00
Victor Zverovich
3bc97a5564 Merge pull request #241 from Gachapen/fix_fileno
Fix fileno causing compile error when #defined
2015-12-03 20:15:10 -08:00
Magnus Bjerke Vik
c2ffa14684 Fix fileno causing compile error when #defined
Error:
expected unqualified-id before '(' token
 int fmt::BufferedFile::fileno() const {

This is an issue with Android NDK and mingw32.
2015-12-03 23:21:42 +01:00
vitaut
535dbdd1c8 Move formatter methods to the header
and improve naming consistency
2015-12-03 09:38:06 -08:00
vitaut
00d56e06ef Bump version 2015-12-03 08:15:03 -08:00
vitaut
7e94fcb680 Reapply accidentally reverted changes by ReadmeCritic 2015-12-03 08:09:53 -08:00
vitaut
6ced4230f4 Initial support for custom formatters 2015-12-02 08:41:05 -08:00
vitaut
5f8af5ef1d Update version 2015-12-01 07:33:30 -08:00
vitaut
5837851cb2 Update docs 2015-12-01 07:31:15 -08:00
vitaut
abe932164a Update changelog 2015-12-01 07:20:33 -08:00
Victor Zverovich
19de4a863a Merge pull request #236 from Jopie64/master
Silence some performance warnings in Visual Studio
2015-12-01 06:58:09 -08:00
Johan 't Hart
328c8888ec Make compilable under Visual Studio 2008
Older Visual Studio versions are not shipped with stdint.h
2015-12-01 09:34:13 +01:00