2019-10-22 18:42:18 +01:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2020-03-01 05:58:02 +00:00
|
|
|
project(aaruremote C)
|
2019-10-20 17:16:47 +01:00
|
|
|
include(CheckIncludeFiles)
|
|
|
|
|
include(CheckLibraryExists)
|
2019-10-22 00:44:39 +01:00
|
|
|
include(TestBigEndian)
|
2019-10-12 13:06:21 +01:00
|
|
|
set(CMAKE_C_STANDARD 90)
|
|
|
|
|
|
2020-03-01 19:47:15 +00:00
|
|
|
set(MAIN_SOURCES aaruremote.h endian.h hex2bin.c list_devices.c main.c worker.c)
|
2019-10-13 00:05:13 +01:00
|
|
|
|
2020-03-01 05:58:02 +00:00
|
|
|
add_library(aaruremotecore ${MAIN_SOURCES})
|
2019-10-20 17:06:02 +01:00
|
|
|
|
2019-10-22 00:44:39 +01:00
|
|
|
CHECK_INCLUDE_FILES("endian.h" HAVE_ENDIAN_H)
|
|
|
|
|
|
|
|
|
|
if (HAVE_ENDIAN_H)
|
|
|
|
|
add_definitions(-DHAVE_ENDIAN_H)
|
|
|
|
|
endif ()
|
|
|
|
|
|
2019-10-20 19:23:34 +01:00
|
|
|
if (WII)
|
|
|
|
|
set(CMAKE_C_FLAGS "-mrvl -mcpu=750 -meabi -mhard-float")
|
|
|
|
|
add_definitions(-DGEKKO=1)
|
|
|
|
|
include_directories($ENV{DEVKITPRO}/libogc/include/)
|
2019-10-22 00:44:39 +01:00
|
|
|
add_definitions(-D__BYTE_ORDER=4321)
|
|
|
|
|
else ()
|
|
|
|
|
if (NOT HAVE_ENDIAN_H AND NOT HAVE_SYS_ENDIAN_H)
|
|
|
|
|
TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
|
|
|
|
|
if (IS_BIG_ENDIAN)
|
|
|
|
|
add_definitions(-D__BYTE_ORDER=4321)
|
|
|
|
|
else ()
|
|
|
|
|
add_definitions(-D__BYTE_ORDER=1234)
|
|
|
|
|
endif ()
|
|
|
|
|
endif ()
|
2019-10-20 17:11:12 +01:00
|
|
|
endif ()
|
|
|
|
|
|
2019-10-22 00:44:39 +01:00
|
|
|
|
2020-10-26 01:11:00 +00:00
|
|
|
set(AARU_PORTS "linux;wii;win32;freebsd" CACHE STRING "List of ports to build")
|
2020-03-01 05:58:02 +00:00
|
|
|
foreach (PORT IN LISTS AARU_PORTS)
|
2019-10-20 19:23:34 +01:00
|
|
|
add_subdirectory(${PORT})
|
2019-10-22 00:44:39 +01:00
|
|
|
endforeach (PORT)
|
|
|
|
|
|