2018-05-09 18:07:18 +08:00
|
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
|
|
|
|
project(box86)
|
|
|
|
|
|
|
|
option(PANDORA "Set to ON if targeting an OpenPandora device" ${PANDORA})
|
2018-11-10 16:47:20 +08:00
|
|
|
option(USE_CCACHE "Set to ON to use ccache if present in the system" ${USE_CCACHE})
|
|
|
|
|
2018-05-09 18:07:18 +08:00
|
|
|
|
|
|
|
# Pandora
|
|
|
|
if(PANDORA)
|
|
|
|
add_definitions(-DPANDORA)
|
|
|
|
add_definitions(-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -fsingle-precision-constant -ffast-math)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_definitions(-g -std=gnu99 -funwind-tables -O3 -fvisibility=hidden)
|
|
|
|
|
2018-11-10 16:47:20 +08:00
|
|
|
if(USE_CCACHE)
|
|
|
|
find_program(CCACHE_FOUND ccache)
|
|
|
|
if(CCACHE_FOUND)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2018-05-09 18:07:18 +08:00
|
|
|
#include_directories(include)
|
|
|
|
|
|
|
|
SET(ELFLOADER_SRC
|
|
|
|
src/main.c
|
2018-07-01 22:36:02 +08:00
|
|
|
src/pathcoll.c
|
2018-10-14 16:24:50 +08:00
|
|
|
src/box86context.c
|
2018-10-14 16:50:19 +08:00
|
|
|
src/fileutils.c
|
2018-10-14 18:15:58 +08:00
|
|
|
src/elfloader.c
|
2018-11-10 17:48:42 +08:00
|
|
|
src/elfload_dump.c
|
2018-05-09 18:07:18 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(box86 ${ELFLOADER_SRC})
|
|
|
|
target_link_libraries(box86 m dl rt)
|