vcpkg/ports/triton/portfile.cmake

54 lines
1.5 KiB
CMake
Raw Normal View History

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO JonathanSalwan/Triton
REF 243026c9c1e07a5ca834c4aaf628d1079f6a85ea
SHA512 9e46c500203647de545286b78a7d4ae6da1796b8eed30fe7346ae6e51865ef70de1adb858c402c3687c471ad654cc6aefdff8893196f5ef7b45e4cee6dd9c577
PATCHES
001-fix-dependency-z3.patch
002-fix-capstone-5.patch
003-fix-python.patch
)
string(COMPARE NOTEQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" DYNAMICLIB)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATICCRT)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"python" PYTHON_BINDINGS
)
set(ADDITIONAL_OPTIONS )
if(PYTHON_BINDINGS)
vcpkg_find_acquire_program(PYTHON3)
list(APPEND ADDITIONAL_OPTIONS
-DPYTHON_EXECUTABLE=${PYTHON3}
)
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DZ3_INTERFACE=ON
-DTRITON_BOOST_INTERFACE=OFF
-DBUILD_SHARED_LIBS=${DYNAMICLIB}
-DMSVC_STATIC=${STATICCRT}
-DBUILD_EXAMPLES=OFF
-DENABLE_TEST=OFF
${ADDITIONAL_OPTIONS}
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
# Move cmake configs
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
# Remove duplicate files
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share")
# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)