mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add native and cross compiling CMake build support
This commit is contained in:
+6
-17
@@ -1,23 +1,12 @@
|
||||
# Build the C files in the mruby src directory
|
||||
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
if(CMAKE_VERSION VERSION_GREATER "2.8.0")
|
||||
cmake_policy(SET CMP0012 OLD)
|
||||
endif()
|
||||
# build the core mruby C files
|
||||
|
||||
find_package(BISON)
|
||||
BISON_TARGET(mruby parse.y ${CMAKE_CURRENT_BINARY_DIR}/parse.c)
|
||||
bison_target(mruby parse.y "${CMAKE_CURRENT_BINARY_DIR}/parse.c")
|
||||
|
||||
# configure_file("config.in.h" "config.h")
|
||||
file(GLOB MRUBY_SRC_C "*.c")
|
||||
add_library(ritevm_object OBJECT ${MRUBY_SRC_C})
|
||||
add_library(ritevm_static STATIC $<TARGET_OBJECTS:ritevm_object>)
|
||||
add_library(ritevm SHARED $<TARGET_OBJECTS:ritevm_object>)
|
||||
list(APPEND MRUBY_SRC_C "${CMAKE_CURRENT_BINARY_DIR}/parse.c")
|
||||
|
||||
add_library(mruby_object OBJECT ${MRUBY_SRC_C} ${BISON_mruby_OUTPUTS})
|
||||
add_library(mruby_static STATIC EXCLUDE_FROM_ALL $<TARGET_OBJECTS:mruby_object>)
|
||||
|
||||
# target_link_libraries(ritevm ${MRUBY_LIBS})
|
||||
# target_link_libraries(ritevm_static ${MRUBY_LIBS})
|
||||
# install(TARGETS ritevm ritevm_static
|
||||
# LIBRARY DESTINATION lib
|
||||
# ARCHIVE DESTINATION lib)
|
||||
|
||||
# vim: ts=2 sts=2 sw=2 et
|
||||
|
||||
Reference in New Issue
Block a user