mp-s7/mp-s7-src/CMakeLists.txt

88 lines
2.0 KiB
CMake
Raw Normal View History

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)
#micropython/lib/utils - library
add_library(mp_lib_utils
../micropython/lib/utils/stdout_helpers.c
../micropython/lib/utils/pyexec.h
../micropython/lib/utils/pyexec.c
)
target_include_directories(mp_lib_utils PUBLIC
../micropython/
../micropython/ports/minimal/build/
./
)
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/
./
)
#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
stringio.cc
)
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
file(GLOB micropython_SRC
#../micropython/ports/minimal/build/_frozen_mpy.c
2019-11-02 19:00:04 +00:00
mpconfigport.h
mphalport.h
mphalport.c
stringio.cc
main.cc
2019-11-02 19:00:04 +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
mp_lib_utils
mp_lib_readline
mp_py
2019-11-02 19:00:04 +00:00
)