cmake build for libretro

This commit is contained in:
Wolfgang Thaller 2012-04-06 00:45:04 +02:00
parent de0aa6610b
commit 2194af326d
4 changed files with 28 additions and 4 deletions

View File

@ -1,11 +1,16 @@
set(CMAKE_CXX_FLAGS "-std=c++11")
cmake_minimum_required(VERSION 2.8)
set(CMAKE_CXX_FLAGS "-std=c++11") # -fomit-frame-pointer")
add_executable(Test
test.cc
Console.cc
Console.h
MacUtils.h)
MacUtils.h
)
#target_link_libraries(Test :retrocrt.o)
target_link_libraries(Test retrocrt)
add_custom_command(
OUTPUT Test.dsk
COMMAND ${MAKE_APPL} -c Test
COMMAND ${MAKE_APPL} -b -c Test
DEPENDS Test)
add_custom_target(TestAPPL ALL DEPENDS Test.dsk)

3
CMakeLists.txt Normal file
View File

@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 2.8)
add_subdirectory(libretro)
add_subdirectory(App2)

14
libretro/CMakeLists.txt Normal file
View File

@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 2.8)
add_library(retrocrt_multi
start.c
malloc.c
syscalls.c
)
add_custom_command(
OUTPUT retrocrt.o
DEPENDS retrocrt_multi
COMMAND ${CMAKE_LINKER} -r -o retrocrt.o --whole-archive libretrocrt_multi.a
)
add_library(retrocrt retrocrt.o glue.c)
#add_custom_target(retrocrt_o ALL DEPENDS retrocrt.o)
install(TARGETS retrocrt DESTINATION lib)

View File

@ -2,10 +2,12 @@ set( CMAKE_SYSTEM_NAME Retro68 )
set( CMAKE_SYSTEM_VERSION 1)
set( RETRO68_ROOT "" CACHE PATH "path to root of Retro68 Toolchain" )
set( CMAKE_INSTALL_PREFIX "${RETRO68_ROOT}/m68k-unknown-elf/" CACHE PATH "installation prefix" )
set( MAKE_APPL "${RETRO68_ROOT}/bin/MakeAPPL" )
set( CMAKE_C_COMPILER "${RETRO68_ROOT}/bin/m68k-unknown-elf-gcc" )
set( CMAKE_CXX_COMPILER "${RETRO68_ROOT}/bin/m68k-unknown-elf-g++" )
set( CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,-elf2flt -Wl,-q -l:retrocrt.o")
set( CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,-elf2flt -Wl,-q" )