Make target provide jerry-port.c
JerryScript-DCO-1.0-Signed-off-by: François Baldassari francois@pebble.com
This commit is contained in:
@@ -147,6 +147,13 @@ project (JerryCore C ASM)
|
||||
${SOURCE_CORE_PARSER_REGEXP}
|
||||
${SOURCE_CORE_JRT})
|
||||
|
||||
# Jerry port
|
||||
if(USE_DEFAULT_PORT)
|
||||
file(GLOB SOURCE_PORT_FILES ${CMAKE_SOURCE_DIR}/targets/default/*.c)
|
||||
else()
|
||||
set(SOURCE_PORT_FILES ${SOURCE_PORT_IMPLEMENTATION})
|
||||
endif()
|
||||
|
||||
# All-in-one build
|
||||
if("${ENABLE_ALL_IN_ONE}" STREQUAL "ON")
|
||||
set(ALL_IN_FILE "${CMAKE_BINARY_DIR}/jerry-all-in.c")
|
||||
@@ -157,9 +164,13 @@ project (JerryCore C ASM)
|
||||
file(APPEND ${ALL_IN_FILE} "#include \"${FILE}\"\n")
|
||||
endforeach()
|
||||
|
||||
foreach(FILE ${SOURCE_PORT_FILES})
|
||||
file(APPEND ${ALL_IN_FILE} "#include \"${FILE}\"\n")
|
||||
endforeach()
|
||||
|
||||
set(SOURCE_CORE ${ALL_IN_FILE})
|
||||
else()
|
||||
set(SOURCE_CORE ${SOURCE_CORE_FILES})
|
||||
set(SOURCE_CORE ${SOURCE_CORE_FILES} ${SOURCE_PORT_FILES})
|
||||
endif()
|
||||
|
||||
# Per-option configuration
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
/* Copyright 2014-2016 Samsung Electronics Co., Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "jerry-port.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
/**
|
||||
* Provide log message to filestream implementation for the engine.
|
||||
*/
|
||||
int jerry_port_logmsg (FILE *stream, /**< stream pointer */
|
||||
const char *format, /**< format string */
|
||||
...) /**< parameters */
|
||||
{
|
||||
va_list args;
|
||||
int count;
|
||||
va_start (args, format);
|
||||
count = vfprintf (stream, format, args);
|
||||
va_end (args);
|
||||
return count;
|
||||
} /* jerry_port_logmsg */
|
||||
|
||||
/**
|
||||
* Provide error message to console implementation for the engine.
|
||||
*/
|
||||
int jerry_port_errormsg (const char *format, /**< format string */
|
||||
...) /**< parameters */
|
||||
{
|
||||
va_list args;
|
||||
int count;
|
||||
va_start (args, format);
|
||||
count = vfprintf (stderr, format, args);
|
||||
va_end (args);
|
||||
return count;
|
||||
} /* jerry_port_errormsg */
|
||||
|
||||
/**
|
||||
* Provide output character to console implementation for the engine.
|
||||
*/
|
||||
int jerry_port_putchar (int c) /**< character to put */
|
||||
{
|
||||
return putchar ((unsigned char) c);
|
||||
} /* jerry_port_putchar */
|
||||
Reference in New Issue
Block a user