[intelrdfpmathlib] Install CMake config files, more headers, test port (#50083)
Co-authored-by: Kai Pastor <dg0yt@darc.de>
This commit is contained in:
co-authored by
Kai Pastor
parent
7853666070
commit
e04c8cc8c7
@@ -258,11 +258,19 @@ else()
|
||||
add_compile_options(-Defi2=1 -DEFI2=1)
|
||||
endif()
|
||||
|
||||
|
||||
include_directories(. src float128)
|
||||
|
||||
add_library(intel_decimal128 ${intelrdfpmathlib_SOURCES})
|
||||
|
||||
set_target_properties(intel_decimal128 PROPERTIES EXPORT_NAME decimal128)
|
||||
|
||||
target_include_directories(
|
||||
intel_decimal128
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/float128>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
target_compile_definitions(
|
||||
intel_decimal128 PRIVATE -DDECIMAL_CALL_BY_REFERENCE=0 -DDECIMAL_GLOBAL_ROUNDING=0 -DDECIMAL_GLOBAL_EXCEPTION_FLAGS=0
|
||||
)
|
||||
@@ -278,12 +286,19 @@ else()
|
||||
endif()
|
||||
|
||||
install(
|
||||
TARGETS intel_decimal128
|
||||
TARGETS intel_decimal128
|
||||
EXPORT unofficial-intelrdfpmathlib-config
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
install(
|
||||
EXPORT unofficial-intelrdfpmathlib-config
|
||||
NAMESPACE unofficial::intelrdfpmathlib::
|
||||
DESTINATION share/unofficial-intelrdfpmathlib
|
||||
)
|
||||
|
||||
if(NOT DISABLE_INSTALL_HEADERS)
|
||||
install(FILES src/dfp754.h DESTINATION include)
|
||||
install(FILES src/dfp754.h src/bid_conf.h src/bid_functions.h DESTINATION include)
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
diff --git a/LIBRARY/src/bid_functions.h b/LIBRARY/src/bid_functions.h
|
||||
index a2d0cd7..a92481d 100644
|
||||
--- a/LIBRARY/src/bid_functions.h
|
||||
+++ b/LIBRARY/src/bid_functions.h
|
||||
@@ -36,13 +36,12 @@
|
||||
#ifndef _BID_FUNCTIONS_H
|
||||
#define _BID_FUNCTIONS_H
|
||||
|
||||
-#if !defined (__GNUC__) || defined(__QNX__)
|
||||
+#include <fenv.h>
|
||||
#include <wchar.h>
|
||||
-#endif
|
||||
#include <ctype.h>
|
||||
|
||||
// Fix system header issue on Sun solaris and define required type by ourselves
|
||||
-#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__)
|
||||
+#if !defined(__cplusplus) && !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__)
|
||||
typedef int wchar_t;
|
||||
#endif
|
||||
|
||||
@@ -150,23 +149,6 @@ typedef BID_UINT128 _Quad;
|
||||
///////////////////////////////////////////////////////
|
||||
// This section may move to fenv_support.h
|
||||
|
||||
-#if !defined(__FENV_H_INCLUDED) && !defined (_FENV_H) && !defined(_FENV_INCLUDED) /* Otherwise we already defined fexcept_t type */
|
||||
-#if defined(__ECL) || defined(__ECC) /* Intel(R) Itanium(R) architecture */
|
||||
-/* Default 64-bit Floating Point Status Register */
|
||||
-#if defined(__linux__)
|
||||
-typedef unsigned long fexcept_t;
|
||||
-#else
|
||||
-typedef unsigned bid__int64 fexcept_t;
|
||||
-#endif
|
||||
-#else
|
||||
-#ifdef __QNX__
|
||||
-#include <fenv.h>
|
||||
-#else
|
||||
-typedef unsigned short int fexcept_t;
|
||||
-#endif
|
||||
-#endif
|
||||
-#endif
|
||||
-
|
||||
#define DEC_FE_INVALID 0x01
|
||||
#define DEC_FE_UNNORMAL 0x02
|
||||
#define DEC_FE_DIVBYZERO 0x04
|
||||
@@ -9,7 +9,9 @@ vcpkg_download_distfile(ARCHIVE
|
||||
vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
PATCHES missing-includes.patch
|
||||
PATCHES
|
||||
missing-includes.patch
|
||||
fix-types.patch
|
||||
)
|
||||
|
||||
set(LIB_SOURCE_PATH "${SOURCE_PATH}/LIBRARY")
|
||||
@@ -24,5 +26,9 @@ vcpkg_cmake_configure(
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_cmake_config_fixup(
|
||||
PACKAGE_NAME unofficial-intelrdfpmathlib
|
||||
)
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL "${SOURCE_PATH}/eula.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
{
|
||||
"name": "intelrdfpmathlib",
|
||||
"version-string": "20U2",
|
||||
"port-version": 6,
|
||||
"port-version": 7,
|
||||
"description": "Intel(R) Decimal Floating-Point Math Library",
|
||||
"supports": "!(arm & windows)",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
|
||||
)
|
||||
vcpkg_cmake_build()
|
||||
@@ -0,0 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(decimal128test)
|
||||
|
||||
find_package(unofficial-intelrdfpmathlib CONFIG REQUIRED)
|
||||
add_executable(main main.cpp)
|
||||
target_link_libraries(main PRIVATE unofficial::intelrdfpmathlib::decimal128)
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <bid_conf.h>
|
||||
#include <bid_functions.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
unsigned int flags = 0;
|
||||
_IDEC_round round_mode = 0;
|
||||
BID_UINT128 x, y;
|
||||
bid128_from_string(const_cast<char*>("1.25673"), round_mode, &flags);
|
||||
bid128_from_int32(5);
|
||||
auto result = bid128_add(x, y, round_mode, &flags);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "vcpkg-ci-intelrdfpmathlib",
|
||||
"version-string": "ci",
|
||||
"description": "Validation port",
|
||||
"dependencies": [
|
||||
"intelrdfpmathlib",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3990,7 +3990,7 @@
|
||||
},
|
||||
"intelrdfpmathlib": {
|
||||
"baseline": "20U2",
|
||||
"port-version": 6
|
||||
"port-version": 7
|
||||
},
|
||||
"intrusive-shared-ptr": {
|
||||
"baseline": "1.9",
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "a0dbc7cfe4c0b1edb3881f23bf0545b8d979e060",
|
||||
"version-string": "20U2",
|
||||
"port-version": 7
|
||||
},
|
||||
{
|
||||
"git-tree": "7cf5496b9f4fbf09ed05be9b87e063a0094ac331",
|
||||
"version-string": "20U2",
|
||||
|
||||
Reference in New Issue
Block a user