Commit Graph

14 Commits

Author SHA1 Message Date
Eric Kilmer 74838a39ba CMake refactor (#105)
* Major CMake refactor

* CI fixes

* Fix CMake errors

* Install graphviz on Windows

* More consistent CMake build types

* Fix compiler defines for Windows

* Fix more bugs

* Add standalone tool building support

* Fix typo

* Update README

* Install sleighLift before trying to smoketest it

* Test coverage preset

The compiler option '-fkeep-inline-functions' originally included with
the coverage build type causes errors with the message "undefined
reference to 'vtable for OpAction*'" for all OpAction subclasses.

This StackOverflow answer might help in resolving this?
https://stackoverflow.com/a/57504289

* Build documentation by default with CI presets

* Use COMPONENT for install commands

This allows for someone to specify which components they want to install
if they only want or need a subset

* Support cross compiling with host system sleigh compiler

* Various fixes found during review

* Move "_WINDOWS" define to CMakeLists.txt file

* Rename ToB 'tools' directory to 'extra-tools'

* Separate projects for sleigh tools

Library is still top-level CMakeLists.txt

More options

* CMake find_package(Git)

* Fix bad merge for patch paths

* Fix missing libconfig.h header install

* Fix issues with installation of headers

* More refactoring

* Refactor sleighexample into its own project/directory

* Refactor specfiles building into separate project/directory

* Check for termios.h header and set define if found

* Update READMEs

* Better consistency with install rules

* Build sleighLift as a standalone project with added source

* More changes to CMake subprojects

* Also add "Specs" component to sleigh installation config

* Try to be better at bootstrapping subprojects (hopefully this doesn't
  bite us, but if it does, I'm happy to remove it and say "not
  supported")

* Address some code review

* Add project sleigh_tool for tool subdirectory

Could make it easier to build just the tools

* Add help text to name the tool executable name

* Add license notice to CMake files

* Fix/Remove too specific CPack packaging configuration

* Consistent capitalization of Sleigh

Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2022-08-22 15:41:53 +10:00
Eric Kilmer 01cf5e5240 Fix wrong CMake cache variable in CI (#115)
Make real fixes to sleigh-lift
2022-07-29 14:33:12 -04:00
Eric Kilmer 66a6b7c472 Update libsleigh single-header include list 2022-07-28 09:28:13 -04:00
ekilmer 70bbd6ce0b Bump Ghidra HEAD commit 75ae8b3
Add new source file marshal.cc and header marshal.hh

Big changes for supporting stable and HEAD

Conditional compilation based on whether sleigh is HEAD version

Expose CMake variable to determine if version is HEAD
2022-07-27 14:49:35 -04:00
Eric Kilmer c7419e7392 Windows support (#85)
* CI: Enable Windows testing

* Fix compilation error on Windows

* Remove compiler warnings as errors

* Move tests to the last step to upload Windows binaries

* Add test for find_package testing in Windows

Makes testing it easier for multi-config generators
2022-05-17 14:49:57 -04:00
Alex Cameron 745bcd7d35 sleigh-lift: Add a --version argument (#46)
* sleigh-lift: Create `--help` and `--version` flags

* cmake: Bring in `git_watcher.cmake`

* support: Add version module to support lib

* support: Add helpers for GHIDRA version and commit hash

* cmake: Cleanup

* cmake, support: Record `cmake-git-version-tracking` Git hash

* sleigh-lift, support: Add helper for GHIDRA release type

* doc: Fix GitHub links to include commit hashes
2022-02-03 12:20:14 +11:00
Alex Cameron c848dda811 sleigh-lift: Fix offset used for image loading (#47) 2022-01-31 09:58:20 -05:00
Eric Kilmer ee2d927807 Remove SLEIGH_ENABLE_INSTALL and use CMake variable (#44)
Create installation rules by default
2022-01-28 11:12:52 +11:00
Alex Cameron 31ec99d69c sleigh-lift: Add support for loading PSPEC files (#37)
* sleigh-lift: Add support for loading PSPEC files

* sleigh-lift: Remove code to manually switch on `longMode`

* doc: Fix README usage text

* Update main.cpp

Co-authored-by: Peter Goodman <peter@trailofbits.com>
2022-01-04 15:22:12 -05:00
Alex Cameron 92671daec5 libsleigh: Add helpers for finding spec files (#24)
* libsleigh: Add helpers for finding spec files

* doc: Update README

* support: Move spec file helpers to separate `support` lib

* support: Use `std::filesystem::path` over `std::string`

* support: Generate helpers with CMake configure instead of macros

* sleigh-lift: Rework optional args and include new SLA path arg

* README: Document support helper

* sleigh-lift: Fix compile warning

* sleigh-lift: Rework default args to `FindSpecFile`

* Apply suggestions from code review

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>

* cmake: Fix quotes

* support: Move build/install directories into separate header

* support: Add missing copyright notice

* support: Mark spec file dirs as static

* cmake: Fix source list since we're generating a header now

* support: Fix search path

* sleigh-lift: Rename arg to `root_sla_dir`

* README: Update usage text

* sleight-lift: Rename option

* Update support/Support.cpp

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>

Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2021-12-09 23:45:53 -05:00
Eric Kilmer 7a1367f284 Use explicit project name instead of variable
Easier to understand and it's already been hard-coded in other places
2021-11-29 13:56:51 +11:00
Eric Kilmer 63e82daee3 Use "sleigh/" include prefix for public headers
The original source code does not set up the headers this way, but it is
best practice to use the project's name prefix to avoid polluting the
include search paths and avoid name conflicts
2021-11-24 09:27:08 -05:00
Eric Kilmer 5ab9583ff5 Add CMake ALIAS for libraries and executables to mimic find_package (#16)
* Add CMake ALIAS for libraries and executables to mimic find_package

This is useful if this project is included as a subdirectory in another
project

* Use aliased targets internally

This is best practice and catches any mispellings before CMake uses the
name as a dynamic link library name
2021-11-23 09:40:15 +11:00
Alex Cameron 66c4f8b915 example: Create sleigh-lift example program (#9)
* cmake: Specify headers for the sla and decomp libraries

* example: Create `sleigh-lift` program

* Move `sleigh-lift` under tools and make it part of the same CMake project

* Turn on more stringent warnings

* Consolidate on types

* Only apply stringent compiler warnings for debug builds

* Add missing cassert include

* Rename `ParseBytes` => `ParseHexBytes`

* Fix types

* Add license header to `sleigh-lift`

* Add section to README introducing `sleigh-lift`

* Reword README

* Add `libsleigh.hh` which includes all SLEIGH headers and applies
appropriate pragmas to silence warnings

* Change `find_package` test to use the `libsleigh.hh` header

* Fix `libsleigh` header to check install directory

* Older version of Clang don't have `-Wdeprecated-copy` as a separate
warning to `-Wdeprecated`
2021-11-05 11:00:27 -04:00