Skip to content

Commit

Permalink
Cxx: Alpine compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
agdavydov81 committed Oct 16, 2023
1 parent 1791549 commit 72af7ce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
11 changes: 5 additions & 6 deletions native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ add_subdirectory (../thirdparty/IntelRDFPMathLib20U2/LIBRARY LIBRARY)

add_library(dfp SHARED NativeImpl.cpp)
target_compile_definitions(dfp PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ JAVA_PREFIX=com_epam_deltix_dfp_NativeImpl_ DECIMALNATIVE_SHARED_LIBRARY DECIMALNATIVE_EXPORTS)
target_link_libraries (dfp LINK_PUBLIC bid)
target_link_libraries(dfp LINK_PUBLIC bid)
set_target_properties(dfp PROPERTIES OUTPUT_NAME "ddfp${VERSION_SUFFIX}")
install(TARGETS dfp DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX})

add_library(dfpmath SHARED NativeMathImpl.c)
target_compile_definitions(dfpmath PRIVATE API_PREFIX=ddfpmath${VERSION_SUFFIX}_ JAVA_PREFIX=com_epam_deltix_dfpmath_NativeMathImpl_)
target_link_libraries (dfpmath LINK_PUBLIC bid)
target_link_libraries(dfpmath LINK_PUBLIC bid)
set_target_properties(dfpmath PROPERTIES OUTPUT_NAME "ddfpmath${VERSION_SUFFIX}")
install(TARGETS dfpmath DESTINATION ./binmath/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX})

file(GLOB BID_SRCS_STATIC
../thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/*.c
../thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/*.c
../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bid.c
../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bessel.c
../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cbrt.c
Expand Down Expand Up @@ -93,6 +93,5 @@ set_target_properties(dfpStatic PROPERTIES OUTPUT_NAME "ddfpStatic${VERSION_SUFF
install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX})

add_executable(demo demo.cpp)
#target_compile_definitions(demo PRIVATE DECIMALNATIVE_SHARED_LIBRARY)
#target_link_libraries (demo LINK_PUBLIC dfp)
target_link_libraries (demo LINK_PUBLIC dfpStatic)
#target_link_libraries(demo LINK_PUBLIC dfp stdc++)
target_link_libraries(demo LINK_PUBLIC dfpStatic stdc++)
2 changes: 1 addition & 1 deletion thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(NAME bid)

file(GLOB ${NAME}_SRCS
src/*.c
src/*.c
float128/dpml_ux_bid.c
float128/dpml_ux_bessel.c
float128/dpml_ux_cbrt.c
Expand Down
3 changes: 2 additions & 1 deletion thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@
#include <wchar.h>
#endif
#include <ctype.h>
#include <stdlib.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

Expand Down

0 comments on commit 72af7ce

Please sign in to comment.