2019-11-02 19:00:04 +00:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
2019-11-08 02:58:20 +00:00
|
|
|
project(MPTests VERSION 0.0.1 LANGUAGES C CXX)
|
2019-11-02 19:00:04 +00:00
|
|
|
|
|
|
|
add_library(RetroConsole
|
|
|
|
retro/Console.cc
|
|
|
|
retro/Console.h
|
|
|
|
retro/ConsoleWindow.cc
|
|
|
|
retro/ConsoleWindow.h
|
|
|
|
retro/MacUtils.h
|
|
|
|
retro/InitConsole.cc
|
|
|
|
)
|
|
|
|
set_target_properties(RetroConsole
|
|
|
|
PROPERTIES
|
|
|
|
COMPILE_OPTIONS -ffunction-sections)
|
|
|
|
|
|
|
|
# different library name for Carbon
|
|
|
|
# (Carbon shares the powerpc-apple-macos/ directory with Classic PPC)
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES RetroCarbon)
|
|
|
|
set_target_properties(RetroConsole PROPERTIES OUTPUT_NAME RetroConsoleCarbon)
|
|
|
|
endif()
|
|
|
|
target_include_directories(RetroConsole PUBLIC .)
|
|
|
|
|
|
|
|
install(TARGETS RetroConsole DESTINATION lib)
|
|
|
|
|
2019-11-02 19:26:38 +00:00
|
|
|
#micropython/lib/utils - library
|
|
|
|
add_library(mp_lib_utils
|
|
|
|
../micropython/lib/utils/stdout_helpers.c
|
2019-11-04 02:41:42 +00:00
|
|
|
../micropython/lib/utils/pyexec.h
|
|
|
|
../micropython/lib/utils/pyexec.c
|
2019-11-02 19:26:38 +00:00
|
|
|
)
|
|
|
|
target_include_directories(mp_lib_utils PUBLIC
|
|
|
|
../micropython/
|
|
|
|
../micropython/ports/minimal/build/
|
|
|
|
./
|
|
|
|
)
|
2019-11-04 02:41:42 +00:00
|
|
|
add_library(mp_lib_readline
|
|
|
|
../micropython/lib/mp-readline/readline.h
|
|
|
|
../micropython/lib/mp-readline/readline.c
|
|
|
|
)
|
|
|
|
target_include_directories(mp_lib_readline PUBLIC
|
|
|
|
../micropython/
|
|
|
|
../micropython/ports/minimal/build/
|
|
|
|
./
|
|
|
|
)
|
2019-11-02 19:26:38 +00:00
|
|
|
|
|
|
|
#micropython/py - main codebase
|
|
|
|
file(GLOB mp_py_SRC
|
|
|
|
"../micropython/py/*.c"
|
|
|
|
../micropython/lib/utils/stdout_helpers.c #TODO: can I get rid of this line?
|
|
|
|
../micropython/ports/minimal/build/_frozen_mpy.c
|
|
|
|
mpconfigport.h
|
|
|
|
mphalport.h
|
2019-11-04 02:41:42 +00:00
|
|
|
stringio.cc
|
2019-11-02 19:26:38 +00:00
|
|
|
)
|
|
|
|
add_library(mp_py ${mp_py_SRC})
|
|
|
|
target_include_directories(mp_py PUBLIC
|
|
|
|
../micropython/
|
|
|
|
../micropython/ports/minimal/build/
|
|
|
|
./
|
|
|
|
)
|
|
|
|
|
2019-11-02 19:00:04 +00:00
|
|
|
|
|
|
|
#App parts
|
|
|
|
|
2019-11-02 19:26:38 +00:00
|
|
|
file(GLOB micropython_SRC
|
|
|
|
#../micropython/ports/minimal/build/_frozen_mpy.c
|
2019-11-02 19:00:04 +00:00
|
|
|
mpconfigport.h
|
|
|
|
mphalport.h
|
2019-11-02 19:26:38 +00:00
|
|
|
mphalport.c
|
2019-11-04 02:41:42 +00:00
|
|
|
stringio.cc
|
|
|
|
main.cc
|
2019-11-02 19:00:04 +00:00
|
|
|
)
|
2019-11-02 19:26:38 +00:00
|
|
|
add_application(MPTests ${micropython_SRC})
|
2019-11-02 19:00:04 +00:00
|
|
|
|
|
|
|
target_include_directories(MPTests
|
|
|
|
PUBLIC ../micropython/
|
|
|
|
../micropython/ports/minimal/build/
|
|
|
|
./
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(MPTests
|
|
|
|
RetroConsole
|
2019-11-02 19:26:38 +00:00
|
|
|
mp_lib_utils
|
2019-11-04 02:41:42 +00:00
|
|
|
mp_lib_readline
|
2019-11-02 19:26:38 +00:00
|
|
|
mp_py
|
2019-11-02 19:00:04 +00:00
|
|
|
)
|
|
|
|
|