Skip to content
Snippets Groups Projects
Commit b9d3f485 authored by Antonio Flores Montoya's avatar Antonio Flores Montoya
Browse files

adjust build scripts and add description in README

parent d073de85
No related branches found
No related tags found
1 merge request!3Collect pointer locations and add a decode instruction method
...@@ -11,12 +11,16 @@ PROJECT(ehp) ...@@ -11,12 +11,16 @@ PROJECT(ehp)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
option(USE_ELFIO "Use the elfio library to parse elf files" OFF)
if(USE_ELFIO)
add_definitions(-DUSE_ELFIO)
endif()
# Use C++17 # Use C++17
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
# Error if it's not available # Error if it's not available
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Base include path for ehp # Base include path for ehp
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
......
...@@ -10,4 +10,23 @@ Notes: ...@@ -10,4 +10,23 @@ Notes:
1. Additional documentation will be provided in later versions 1. Additional documentation will be provided in later versions
1. API is incomplete and untested in some areas. Future versions will improve stability. 1. API is incomplete and untested in some areas. Future versions will improve stability.
1. Use `git clone --recursive` to pull down required submodules 1. Use `git clone --recursive` to pull down required submodules
1. Build with `scons`, add `debug=1` for debug build 1. Build with `scons`, add `debug=1` for debug build, add '--no_elfio' to compile without the third party libraries
## Compilation with cmake
To compile with cmake type:
```
cmake . -Bbuild
cd build
cmake --build .
```
In contrast to scons, the default compilation in cmake is **without** the elfio library. If you want to compile with elfio
use the following commands:
```
cmake . -Bbuild -DUSE_ELFIO=ON
cd build
cmake --build .
```
\ No newline at end of file
...@@ -26,11 +26,20 @@ cpppath=''' ...@@ -26,11 +26,20 @@ cpppath='''
''' '''
cpppath=cpppath+Dir('.').srcnode().abspath+'/../third-party/elfio-code' cpppath=cpppath+Dir('.').srcnode().abspath+'/../third-party/elfio-code'
AddOption('--no_elfio',
dest='no_elfio',
action='store_true',
default=False,
help='Do not use Elfio library to parse elf files')
cpp_defines={}
if( not GetOption('no_elfio')):
cpp_defines['USE_ELFIO']=1
LIBPATH="$SECURITY_TRANSFORMS_HOME/lib" LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
LIBS=Split("") LIBS=Split("")
myenv=myenv.Clone(CPPPATH=Split(cpppath)) myenv=myenv.Clone(CPPPATH=Split(cpppath),CPPDEFINES=cpp_defines)
myenv.Append(CXXFLAGS = " -std=c++11 -Wall -Werror -fmax-errors=2 -fPIC ") myenv.Append(CXXFLAGS = " -std=c++11 -Wall -Werror -fmax-errors=2 -fPIC ")
lib1=myenv.Library("ehp", Split(files), LIBPATH=LIBPATH, LIBS=LIBS) lib1=myenv.Library("ehp", Split(files), LIBPATH=LIBPATH, LIBS=LIBS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment