Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions ports/intelrdfpmathlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,17 @@ else()
add_compile_options(-Defi2=1 -DEFI2=1)
endif()


include_directories(. src float128)

add_library(intel_decimal128 ${intelrdfpmathlib_SOURCES})
Comment thread
ajtribick marked this conversation as resolved.

target_include_directories(
intel_decimal128
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/float128>
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
Comment thread
ajtribick marked this conversation as resolved.
Outdated
$<INSTALL_INTERFACE:include>
)

target_compile_definitions(
intel_decimal128 PRIVATE -DDECIMAL_CALL_BY_REFERENCE=0 -DDECIMAL_GLOBAL_ROUNDING=0 -DDECIMAL_GLOBAL_EXCEPTION_FLAGS=0
)
Expand All @@ -278,12 +284,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::intel::
Comment thread
ajtribick marked this conversation as resolved.
Outdated
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()
13 changes: 13 additions & 0 deletions ports/intelrdfpmathlib/fix-wchar.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/LIBRARY/src/bid_functions.h b/LIBRARY/src/bid_functions.h
index a2d0cd7..8411c44 100644
--- a/LIBRARY/src/bid_functions.h
+++ b/LIBRARY/src/bid_functions.h
@@ -42,7 +42,7 @@
#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(__WCHAR_TYPE__) && !defined(__QNX__)
typedef int wchar_t;
#endif

8 changes: 7 additions & 1 deletion ports/intelrdfpmathlib/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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-wchar.patch
)

set(LIB_SOURCE_PATH "${SOURCE_PATH}/LIBRARY")
Expand All @@ -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)
6 changes: 5 additions & 1 deletion ports/intelrdfpmathlib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
6 changes: 6 additions & 0 deletions scripts/test_ports/vcpkg-ci-intelrdfpmathlib/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

vcpkg_cmake_configure(
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
)
vcpkg_cmake_build()
Original file line number Diff line number Diff line change
@@ -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::intel::intel_decimal128)
13 changes: 13 additions & 0 deletions scripts/test_ports/vcpkg-ci-intelrdfpmathlib/project/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#define DECIMAL_CALL_BY_REFERENCE 0
#define DECIMAL_GLOBAL_ROUNDING 1

#include <bid_conf.h>
#include <bid_functions.h>

int main()
{
unsigned int flags = 0;
BID_UINT128 x = bid128_from_string(const_cast<char*>("1.25673"), &flags);
BID_UINT128 y = bid128_from_int32(5);
auto result = bid128_add(x, y, &flags);
}
12 changes: 12 additions & 0 deletions scripts/test_ports/vcpkg-ci-intelrdfpmathlib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "vcpkg-ci-intelrdfpmathlib",
"version-string": "ci",
"description": "Validation port",
"dependencies": [
"intelrdfpmathlib",
{
"name": "vcpkg-cmake",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3990,7 +3990,7 @@
},
"intelrdfpmathlib": {
"baseline": "20U2",
"port-version": 6
"port-version": 7
},
"intrusive-shared-ptr": {
"baseline": "1.9",
Expand Down
5 changes: 5 additions & 0 deletions versions/i-/intelrdfpmathlib.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c71a23ba41439c949da35fcb843cc7fbcc8c4935",
"version-string": "20U2",
"port-version": 7
},
{
"git-tree": "7cf5496b9f4fbf09ed05be9b87e063a0094ac331",
"version-string": "20U2",
Expand Down
Loading