summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJon <[email protected]>2012-05-02 20:46:09 -0400
committerJon <[email protected]>2012-05-22 10:50:28 -0400
commit9f89da6eef2c830db6fc3abb08fe755ae7ce9b6c (patch)
treed1feb367d93853b5f05ce2bbed2171a561631b31 /src
parentb5dcb7128d7d235b66b4d9be879d26364dd1e3e9 (diff)
downloadmruby-9f89da6eef2c830db6fc3abb08fe755ae7ce9b6c.tar.gz
mruby-9f89da6eef2c830db6fc3abb08fe755ae7ce9b6c.zip
Add native and cross compiling CMake build support
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt23
-rw-r--r--src/Makefile (renamed from src/Makefile.orig)0
2 files changed, 6 insertions, 17 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b25711ae3..390129eb9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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")
-# target_link_libraries(ritevm ${MRUBY_LIBS})
-# target_link_libraries(ritevm_static ${MRUBY_LIBS})
-# install(TARGETS ritevm ritevm_static
-# LIBRARY DESTINATION lib
-# ARCHIVE DESTINATION lib)
+add_library(mruby_object OBJECT ${MRUBY_SRC_C} ${BISON_mruby_OUTPUTS})
+add_library(mruby_static STATIC EXCLUDE_FROM_ALL $<TARGET_OBJECTS:mruby_object>)
+# vim: ts=2 sts=2 sw=2 et
diff --git a/src/Makefile.orig b/src/Makefile
index 14485041d..14485041d 100644
--- a/src/Makefile.orig
+++ b/src/Makefile