vcpkg/ports/argon2/CMakeLists.txt

76 lines
2.1 KiB
CMake
Raw Normal View History

2023-04-25 09:33:59 +08:00
cmake_minimum_required(VERSION 3.25)
[Argon2] Add new port (#24747) * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * publish the command line tool * Argon2 port * add version info for argon2 * use preferred vcpkg cmake functions * update version * fix compile of x64-windows-static * update version * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * install pdbs Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * add argon2 licence * use target-specific functions for link libraries * use upstream pkgconfig file * export library for cmake * update version hash * don't use deprecated vcpkg_fixup_cmake_targets * fix cmake integration * update version * fix thread.c includes when building on mingw32 * export header path and thread dependency properly * don't export the argon2_tool * fix output clash between library and tool on mingw * use declspec for symbol visibility with mingw * update version * fix missing PDBs for library due to tool/library filename clash * update argon2 version * quote filenames for safety Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * update arong2 version * note upstream PR for visibility patch * always build with hardware optimizations if supported by compiler * update argon2 version Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2022-08-30 07:38:21 +08:00
2023-04-25 09:33:59 +08:00
project(argon2 LANGUAGES C)
[Argon2] Add new port (#24747) * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * publish the command line tool * Argon2 port * add version info for argon2 * use preferred vcpkg cmake functions * update version * fix compile of x64-windows-static * update version * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * install pdbs Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * add argon2 licence * use target-specific functions for link libraries * use upstream pkgconfig file * export library for cmake * update version hash * don't use deprecated vcpkg_fixup_cmake_targets * fix cmake integration * update version * fix thread.c includes when building on mingw32 * export header path and thread dependency properly * don't export the argon2_tool * fix output clash between library and tool on mingw * use declspec for symbol visibility with mingw * update version * fix missing PDBs for library due to tool/library filename clash * update argon2 version * quote filenames for safety Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * update arong2 version * note upstream PR for visibility patch * always build with hardware optimizations if supported by compiler * update argon2 version Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2022-08-30 07:38:21 +08:00
2023-04-25 09:33:59 +08:00
option(WITH_OPTIMIZATIONS "Enable SSE2/AVX2/AVX512 optimizations")
option(BUILD_TOOL "Build the tool" OFF)
[Argon2] Add new port (#24747) * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * publish the command line tool * Argon2 port * add version info for argon2 * use preferred vcpkg cmake functions * update version * fix compile of x64-windows-static * update version * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * install pdbs Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * add argon2 licence * use target-specific functions for link libraries * use upstream pkgconfig file * export library for cmake * update version hash * don't use deprecated vcpkg_fixup_cmake_targets * fix cmake integration * update version * fix thread.c includes when building on mingw32 * export header path and thread dependency properly * don't export the argon2_tool * fix output clash between library and tool on mingw * use declspec for symbol visibility with mingw * update version * fix missing PDBs for library due to tool/library filename clash * update argon2 version * quote filenames for safety Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * update arong2 version * note upstream PR for visibility patch * always build with hardware optimizations if supported by compiler * update argon2 version Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2022-08-30 07:38:21 +08:00
2023-04-25 09:33:59 +08:00
if(BUILD_SHARED_LIBS)
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
endif()
[Argon2] Add new port (#24747) * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * publish the command line tool * Argon2 port * add version info for argon2 * use preferred vcpkg cmake functions * update version * fix compile of x64-windows-static * update version * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * install pdbs Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * add argon2 licence * use target-specific functions for link libraries * use upstream pkgconfig file * export library for cmake * update version hash * don't use deprecated vcpkg_fixup_cmake_targets * fix cmake integration * update version * fix thread.c includes when building on mingw32 * export header path and thread dependency properly * don't export the argon2_tool * fix output clash between library and tool on mingw * use declspec for symbol visibility with mingw * update version * fix missing PDBs for library due to tool/library filename clash * update argon2 version * quote filenames for safety Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * update arong2 version * note upstream PR for visibility patch * always build with hardware optimizations if supported by compiler * update argon2 version Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2022-08-30 07:38:21 +08:00
endif()
find_package(Threads REQUIRED)
set(ARGON2_HEADERS
include/argon2.h
)
set (ARGON2_SRC
2023-04-25 09:33:59 +08:00
src/argon2.c
src/core.c
src/blake2/blake2b.c
src/thread.c
src/encoding.c
[Argon2] Add new port (#24747) * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * publish the command line tool * Argon2 port * add version info for argon2 * use preferred vcpkg cmake functions * update version * fix compile of x64-windows-static * update version * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * install pdbs Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * add argon2 licence * use target-specific functions for link libraries * use upstream pkgconfig file * export library for cmake * update version hash * don't use deprecated vcpkg_fixup_cmake_targets * fix cmake integration * update version * fix thread.c includes when building on mingw32 * export header path and thread dependency properly * don't export the argon2_tool * fix output clash between library and tool on mingw * use declspec for symbol visibility with mingw * update version * fix missing PDBs for library due to tool/library filename clash * update argon2 version * quote filenames for safety Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * update arong2 version * note upstream PR for visibility patch * always build with hardware optimizations if supported by compiler * update argon2 version Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2022-08-30 07:38:21 +08:00
)
if (WITH_OPTIMIZATIONS)
2023-04-25 09:33:59 +08:00
list(APPEND ARGON2_SRC src/opt.c)
[Argon2] Add new port (#24747) * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * publish the command line tool * Argon2 port * add version info for argon2 * use preferred vcpkg cmake functions * update version * fix compile of x64-windows-static * update version * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * install pdbs Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * add argon2 licence * use target-specific functions for link libraries * use upstream pkgconfig file * export library for cmake * update version hash * don't use deprecated vcpkg_fixup_cmake_targets * fix cmake integration * update version * fix thread.c includes when building on mingw32 * export header path and thread dependency properly * don't export the argon2_tool * fix output clash between library and tool on mingw * use declspec for symbol visibility with mingw * update version * fix missing PDBs for library due to tool/library filename clash * update argon2 version * quote filenames for safety Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * update arong2 version * note upstream PR for visibility patch * always build with hardware optimizations if supported by compiler * update argon2 version Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2022-08-30 07:38:21 +08:00
else()
2023-04-25 09:33:59 +08:00
list(APPEND ARGON2_SRC src/ref.c)
[Argon2] Add new port (#24747) * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * publish the command line tool * Argon2 port * add version info for argon2 * use preferred vcpkg cmake functions * update version * fix compile of x64-windows-static * update version * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * install pdbs Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * add argon2 licence * use target-specific functions for link libraries * use upstream pkgconfig file * export library for cmake * update version hash * don't use deprecated vcpkg_fixup_cmake_targets * fix cmake integration * update version * fix thread.c includes when building on mingw32 * export header path and thread dependency properly * don't export the argon2_tool * fix output clash between library and tool on mingw * use declspec for symbol visibility with mingw * update version * fix missing PDBs for library due to tool/library filename clash * update argon2 version * quote filenames for safety Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * update arong2 version * note upstream PR for visibility patch * always build with hardware optimizations if supported by compiler * update argon2 version Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2022-08-30 07:38:21 +08:00
endif()
add_library(libargon2 ${ARGON2_SRC})
set_target_properties(libargon2 PROPERTIES OUTPUT_NAME argon2)
2023-04-25 09:33:59 +08:00
target_include_directories(libargon2 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include> PRIVATE src)
target_link_libraries(libargon2 PRIVATE Threads::Threads)
if(BUILD_SHARED_LIBS)
if(WIN32)
target_compile_definitions(libargon2 PRIVATE "BUILDING_ARGON2_DLL" INTERFACE "USING_ARGON2_DLL")
else()
target_compile_definitions(libargon2 PRIVATE "A2_VISCTL")
endif()
endif()
[Argon2] Add new port (#24747) * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * publish the command line tool * Argon2 port * add version info for argon2 * use preferred vcpkg cmake functions * update version * fix compile of x64-windows-static * update version * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * install pdbs Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * add argon2 licence * use target-specific functions for link libraries * use upstream pkgconfig file * export library for cmake * update version hash * don't use deprecated vcpkg_fixup_cmake_targets * fix cmake integration * update version * fix thread.c includes when building on mingw32 * export header path and thread dependency properly * don't export the argon2_tool * fix output clash between library and tool on mingw * use declspec for symbol visibility with mingw * update version * fix missing PDBs for library due to tool/library filename clash * update argon2 version * quote filenames for safety Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * update arong2 version * note upstream PR for visibility patch * always build with hardware optimizations if supported by compiler * update argon2 version Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2022-08-30 07:38:21 +08:00
install(TARGETS libargon2
2023-04-25 09:33:59 +08:00
EXPORT unofficial-argon2-targets
[Argon2] Add new port (#24747) * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * publish the command line tool * Argon2 port * add version info for argon2 * use preferred vcpkg cmake functions * update version * fix compile of x64-windows-static * update version * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * install pdbs Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * add argon2 licence * use target-specific functions for link libraries * use upstream pkgconfig file * export library for cmake * update version hash * don't use deprecated vcpkg_fixup_cmake_targets * fix cmake integration * update version * fix thread.c includes when building on mingw32 * export header path and thread dependency properly * don't export the argon2_tool * fix output clash between library and tool on mingw * use declspec for symbol visibility with mingw * update version * fix missing PDBs for library due to tool/library filename clash * update argon2 version * quote filenames for safety Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * update arong2 version * note upstream PR for visibility patch * always build with hardware optimizations if supported by compiler * update argon2 version Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2022-08-30 07:38:21 +08:00
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
2023-04-25 09:33:59 +08:00
if(BUILD_TOOL)
add_executable(argon2 src/run.c)
target_link_libraries(argon2 PRIVATE libargon2)
set_target_properties(argon2 PROPERTIES PDB_NAME "argon2${CMAKE_EXECUTABLE_SUFFIX}.pdb")
install(TARGETS argon2 RUNTIME DESTINATION bin)
endif()
install(FILES ${ARGON2_HEADERS} DESTINATION include)
install(EXPORT unofficial-argon2-targets
[Argon2] Add new port (#24747) * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * publish the command line tool * Argon2 port * add version info for argon2 * use preferred vcpkg cmake functions * update version * fix compile of x64-windows-static * update version * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * install pdbs Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * add argon2 licence * use target-specific functions for link libraries * use upstream pkgconfig file * export library for cmake * update version hash * don't use deprecated vcpkg_fixup_cmake_targets * fix cmake integration * update version * fix thread.c includes when building on mingw32 * export header path and thread dependency properly * don't export the argon2_tool * fix output clash between library and tool on mingw * use declspec for symbol visibility with mingw * update version * fix missing PDBs for library due to tool/library filename clash * update argon2 version * quote filenames for safety Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * update arong2 version * note upstream PR for visibility patch * always build with hardware optimizations if supported by compiler * update argon2 version Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2022-08-30 07:38:21 +08:00
NAMESPACE unofficial::argon2::
2023-04-25 09:33:59 +08:00
DESTINATION "share/unofficial-argon2"
[Argon2] Add new port (#24747) * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * start of argon2 port * continue development * attempt to compile with optimization * add feature to enable hardware optimizations * fix symbol visibility * set symbol visibility * add pkg-config * use libs.private for threading * use last release * publish the command line tool * Argon2 port * add version info for argon2 * use preferred vcpkg cmake functions * update version * fix compile of x64-windows-static * update version * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/argon2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * install pdbs Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * add argon2 licence * use target-specific functions for link libraries * use upstream pkgconfig file * export library for cmake * update version hash * don't use deprecated vcpkg_fixup_cmake_targets * fix cmake integration * update version * fix thread.c includes when building on mingw32 * export header path and thread dependency properly * don't export the argon2_tool * fix output clash between library and tool on mingw * use declspec for symbol visibility with mingw * update version * fix missing PDBs for library due to tool/library filename clash * update argon2 version * quote filenames for safety Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * update arong2 version * note upstream PR for visibility patch * always build with hardware optimizations if supported by compiler * update argon2 version Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2022-08-30 07:38:21 +08:00
)
2023-04-25 09:33:59 +08:00
function(make_pc_file)
set(PREFIX "${CMAKE_INSTALL_PREFIX}")
set(INCLUDE "include")
set(HOST_MULTIARCH "lib")
set(EXTRA_LIBS "")
configure_file ("${CMAKE_SOURCE_DIR}/libargon2.pc.in" "${PROJECT_BINARY_DIR}/libargon2.pc" @ONLY)
endfunction()
make_pc_file()
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/libargon2.pc" DESTINATION "lib/pkgconfig")