9 Commits

Author SHA1 Message Date
Eric Kilmer
7d285ea7b9 CMake better cache variable properties options for sanitizers
Makes it easier for CMake GUI interfaces to know this is a variable that
takes in different strings instead of a boolean.
2021-05-19 17:40:42 -06:00
Eric Kilmer
4286f109b0
Support for building with sanitizers (#149)
* Add support for building with sanitizers

* CI Enable building with ASAN+UBSAN sanitizers in Debug builds

* Add directions to README

* Better CI reporting and matrix for sanitizer runs
2021-03-15 21:50:35 -04:00
Eric Kilmer
e5ba0165ab
Add simple test and corkami test suite using Catch2 (#145)
* Add simple test and corkami test suite using Catch2

* Enable testing with CMake option '-DPEPARSE_ENABLE_TESTING=ON'.

* The simple test is extremely basic just as an example of using Catch2.

* Corkami test suite is a git submodule within assets and the tests can
be run with or without cloning it. You are able to configure CMake
without the submodule and it will warn you that the tests are not
included, and then it will pick them up automatically on next cmake
rebuild.

There are a few Corkami files which pe-parse is unable to process. They
have been added as exceptions for now (just to get this merged), but we
can open new issues to track them. This will also catch any regressions
that could prevent the successful parsing of files that have been
parse-able in the past.

* Raise C++ standard from 11 to 17 for easier filesystem handling in
tests. Also included CMake script for handling how std::filesystem is
found/linked.

* Rename directory 'test' to 'tests'.

* Update README with testing instructions.

* Catch2 is downloaded and built unless otherwise specified
(undocumented, aside from reading CMake).
2021-03-10 14:01:34 -05:00
William Woodruff
c5e9a09087
Dockerfile, cmake: Simplify build (#111)
* Dockerfile, cmake: Simplify build

Always use clang in the Dockerfile, and don't overspecify
the build type.

Additionally, drop -Weverything when building in Debug mode --
it has competing flags internally and isn't intended for actual
builds.

* Dockerfile: Set CC and CXX

Ensures that we build with clang(++).

* python/setup: Blacken
2020-03-09 15:18:54 -04:00
Jack Williams
6ee67f63e1 Icu and codecvt 2 (#88)
* Support for Windows codecvt and icu4c

* Add dependency for Travis

* Update README

* Fix codecvt build for linux

* Fix linux builds

* Fix copyright
2019-09-16 20:59:24 -04:00
Tony Theodore
64989f688a CMake improvements, MinGW compatibility, shared libs support
* mingw-w64 fixes

  - `WIN32` is user-defined, `_WIN32` is pre-defined by toolchain[1]
  - use gcc options instead of MSVC
    - `-fPIC` is redundant on mingw
    - don't error on `old-style-cast`

[1] https://msdn.microsoft.com/en-us/library/b0084kay.aspx

* add option to build shared libs

* add option to disable command line tools

* ignore more Visual Studio files

* enable shared builds on MSVC (with cmake >= 3.4)

https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/

* fix old-style-cast warning
2018-03-27 14:52:05 +02:00
Alessandro Gario
752f526e2e
Fix compilation error on Ubuntu Xenial (#60)
* CMake: Remove -Wstrict-overflow (#59)
This warning has been added by mistake in a previous PR. Closes #59

* Travis: Do not build the examples
2017-12-20 00:13:03 +01:00
Alessandro Gario
b60b908fa2 Install public headers, add Arch package, build pepy under Travis and more (#57)
* CMake: Added install directives

* CMake: Added support for find_package(pe-parse)

* Fixed a compilation error on Linux

* CMake: Fix cmake module installation

* Added ArchLinux package

* Finished implementing the address converted example

* peaddrconv: Print the image base address.

* peaddrconv: Enable more warnings.

* Update travis to also build the examples

* Fix a compilation warning on Ubuntu 14.04

* Travis: Add macOS support.

* Better output for Travis, fix a compilation error on macOS.

* Travis: Do not build examples under macOS.

* Travis: Also compile the python module (pepy)

* Readme: Add a section to show how to use the library.

* Windows: Fix a compilation error, enable /analyze (see details).

The nt-headers.h include file is defining several constexpr values
using reserved (by windows.h) names.

These names (i.e.: IMAGE_FILE_MACHINE_UNKNOWN) are in fact macros
defined inside the Windows header files, and causes the preprocessor
to break definitions such as the following one:

constexpr std::uint16_t IMAGE_FILE_MACHINE_UNKNOWN = 0x0;

The fix (for now) consists in including the nt-headers.h file before
windows.h, but we should probably choose whether to use different
names or avoid defining those values (since they are inside the
system header anyway).
2017-11-25 16:01:53 -05:00
Alessandro Gario
0d0ca1861c Squash (#56)
- CMake: Refactor, added more warnings.
- Refactor
- Added Windows support
- Added a missing include file for linux.
- Do not set CMAKE_CXX_STANDARD on Windows
- Always initialize the stat struct
- CMake: update the required version, request C++11, disable GNU extensions
- CMake: Add default switch cases, fix GCC warnings.
- Prefer assignment from an empty object when initializing
2017-10-19 12:13:35 -04:00