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-12-15 19:55:14 +08:00
|
|
|
src/elfparser.c
|
2018-11-10 17:48:42 +08:00
|
|
|
src/elfload_dump.c
|
2018-12-15 23:17:19 +08:00
|
|
|
src/stack.c
|
2018-12-16 04:20:00 +08:00
|
|
|
src/x86emu.c
|
2018-12-17 04:03:20 +08:00
|
|
|
src/x86run.c
|
2018-12-18 06:24:44 +08:00
|
|
|
src/x86run66.c
|
|
|
|
src/x86run_private.c
|
2018-12-17 04:03:20 +08:00
|
|
|
src/x86primop.c
|
|
|
|
src/x86trace.c
|
2018-05-09 18:07:18 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(box86 ${ELFLOADER_SRC})
|
|
|
|
target_link_libraries(box86 m dl rt)
|