From 9f89da6eef2c830db6fc3abb08fe755ae7ce9b6c Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 2 May 2012 20:46:09 -0400 Subject: Add native and cross compiling CMake build support --- src/CMakeLists.txt | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/CMakeLists.txt') 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 $) -add_library(ritevm SHARED $) - +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 $) +# vim: ts=2 sts=2 sw=2 et -- cgit v1.2.3