Turn modified fdlibm into Jerry's own libm
* Rename modified fdlibm to jerry-libm
* Move third-party/fdlibm to jerry-libm
* Rename original fdlibm.h to jerry-libm-internal.h
* And remove it from the public headers.
* Rename jerry-libm's public header to math.h
* This also makes jerry-core sources include `<math.h>`. Therefore,
should anyone want to use a different libm implementation with
jerry, it becomes possible. (The same way as we provide a minimal
libc with standard headers, but should it be insufficient or
conflicting for someone, it can be replaced.)
* Drop `s_` prefix from jerry-libm sources
* The original fdlibm implementation had various prefixes (e.g., `k_`
for sources of kernel routines, and `w_` for wrapper routines), but
after the specialization of fdlibm to jerry, only `s_` remained.
Since it does not encode anything anymore, it can be dropped.
* Stylistic edits to jerry-libm's CMakeLists
* Align project name with other CMakeLists in the code base
* Move Jerry-LibM under Apache License
* Using the same approach as was used by linux-wireless when ath5k
driver license needed clarification. Solution was proposed by SFLC.
External mail for future reference: http://lwn.net/Articles/247806/
* Tests & checks
* Remove FD from the name of libm unit test-related files
* Make vera++ and cppcheck check jerry-libm
* Targets
* Speculative update of targets to use jerry-libm
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
+10
-11
@@ -37,9 +37,8 @@ project (Jerry C ASM)
|
||||
endif()
|
||||
|
||||
|
||||
# Imported and third-party targets prefix
|
||||
# Imported targets prefix
|
||||
set(PREFIX_IMPORTED_LIB imported_)
|
||||
set(SUFFIX_THIRD_PARTY_LIB .third_party.lib)
|
||||
|
||||
# Architecture-specific compile/link flags
|
||||
foreach(FLAG ${FLAGS_COMMON_ARCH})
|
||||
@@ -372,8 +371,8 @@ endif()
|
||||
add_subdirectory(jerry-libc)
|
||||
endif()
|
||||
|
||||
# Jerry's fdlibm
|
||||
add_subdirectory(third-party/fdlibm)
|
||||
# Jerry's libm
|
||||
add_subdirectory(jerry-libm)
|
||||
|
||||
# Jerry's Core
|
||||
add_subdirectory(jerry-core)
|
||||
@@ -394,7 +393,7 @@ endif()
|
||||
|
||||
set(CORE_TARGET_NAME ${CORE_TARGET_NAME}${MODIFIER_SUFFIX_${MODIFIER}})
|
||||
endforeach()
|
||||
set(FDLIBM_TARGET_NAME ${CORE_TARGET_NAME}.jerry-fdlibm${SUFFIX_THIRD_PARTY_LIB})
|
||||
set(LIBM_TARGET_NAME ${CORE_TARGET_NAME}.jerry-libm.lib)
|
||||
set(CORE_TARGET_NAME ${CORE_TARGET_NAME}.jerry-core)
|
||||
|
||||
set(DEFINES_JERRY )
|
||||
@@ -425,10 +424,10 @@ endif()
|
||||
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${INCLUDE_EXTERNAL_LIBS_INTERFACE})
|
||||
if(("${PLATFORM}" STREQUAL "DARWIN") AND (NOT (CMAKE_COMPILER_IS_GNUCC)))
|
||||
target_link_libraries(${TARGET_NAME} ${CORE_TARGET_NAME} ${LIBC_TARGET_NAME}
|
||||
${FDLIBM_TARGET_NAME} ${PREFIX_IMPORTED_LIB}libclang_rt.osx)
|
||||
${LIBM_TARGET_NAME} ${PREFIX_IMPORTED_LIB}libclang_rt.osx)
|
||||
else()
|
||||
target_link_libraries(${TARGET_NAME} ${CORE_TARGET_NAME} ${LIBC_TARGET_NAME}
|
||||
${FDLIBM_TARGET_NAME} ${PREFIX_IMPORTED_LIB}libgcc)
|
||||
${LIBM_TARGET_NAME} ${PREFIX_IMPORTED_LIB}libgcc)
|
||||
endif()
|
||||
|
||||
if("${PLATFORM}" STREQUAL "MCU")
|
||||
@@ -454,7 +453,7 @@ endif()
|
||||
add_custom_command(TARGET ${TARGET_NAME}
|
||||
POST_BUILD
|
||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/${TARGET_NAME}
|
||||
COMMAND echo $<TARGET_FILE:${FDLIBM_TARGET_NAME}> > ${CMAKE_BINARY_DIR}/${TARGET_NAME}/list
|
||||
COMMAND echo $<TARGET_FILE:${LIBM_TARGET_NAME}> > ${CMAKE_BINARY_DIR}/${TARGET_NAME}/list
|
||||
COMMAND echo $<TARGET_FILE:${CORE_TARGET_NAME}> >> ${CMAKE_BINARY_DIR}/${TARGET_NAME}/list)
|
||||
|
||||
if(DEFINED EXTERNAL_BUILD_ENTRY_FILE)
|
||||
@@ -499,7 +498,7 @@ endif()
|
||||
if (${USE_JERRY_LIBC})
|
||||
set(LIBC_TARGET_NAME unittests.jerry-libc.${PLATFORM_L}.lib)
|
||||
endif ()
|
||||
set(FDLIBM_TARGET_NAME unittests.jerry-fdlibm${SUFFIX_THIRD_PARTY_LIB})
|
||||
set(LIBM_TARGET_NAME unittests.jerry-libm.lib)
|
||||
|
||||
add_executable(${TARGET_NAME} ${SOURCE_UNIT_TEST_MAIN})
|
||||
set_property(TARGET ${TARGET_NAME}
|
||||
@@ -510,10 +509,10 @@ endif()
|
||||
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${INCLUDE_LIBC_INTERFACE})
|
||||
|
||||
if(("${PLATFORM}" STREQUAL "DARWIN") AND (NOT (CMAKE_COMPILER_IS_GNUCC)))
|
||||
target_link_libraries(${TARGET_NAME} ${CORE_TARGET_NAME} ${LIBC_TARGET_NAME} ${FDLIBM_TARGET_NAME}
|
||||
target_link_libraries(${TARGET_NAME} ${CORE_TARGET_NAME} ${LIBC_TARGET_NAME} ${LIBM_TARGET_NAME}
|
||||
${PREFIX_IMPORTED_LIB}libclang_rt.osx)
|
||||
else()
|
||||
target_link_libraries(${TARGET_NAME} ${CORE_TARGET_NAME} ${LIBC_TARGET_NAME} ${FDLIBM_TARGET_NAME}
|
||||
target_link_libraries(${TARGET_NAME} ${CORE_TARGET_NAME} ${LIBC_TARGET_NAME} ${LIBM_TARGET_NAME}
|
||||
${PREFIX_IMPORTED_LIB}libgcc)
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user