vcpkg/ports/simd/portfile.cmake

88 lines
3.2 KiB
CMake
Raw Normal View History

[simd] Add new port (#28163) * Added new port for Simd Created new port for Simd from https://github.com/ermig1979/Simd * Added new port for Simd Created/updated new port for Simd from https://github.com/ermig1979/Simd * Revert "Merge branch 'master' of https://github.com/erdogan61/vcpkg" This reverts commit 789c93e81a6ea996649e314eca852180035361ef, reversing changes made to c87a8183bd518b77b4092bfc27d24ad35686d4d7. * portfile.cmake fixes Update x64-windows-static* and fixes * Update simd.json * Added missing define Set "#define in SIMD_STATIC/src/Simd/SimdConfig.h" * Update simd.json * Update simd.json * Revert "Revert "Merge branch 'master' of https://github.com/erdogan61/vcpkg"" This reverts commit a97bdb05f4cd0590002ca953fbd158cab8db045c. * Added Linux support * Update simd.json * Added Cmake install patch Otherwise build error: "ninja: error: unknown target 'install'" * Update simd.json * Added supports in vcpkg.json * Update simd.json * Removed unsupported builds * x64_uwp failes UWP builds are failing, since not supported, Reason: The following DLLs do not have the App Container bit set: D:/packages/simd_x64-uwp/debug/bin/Simd.dll D:/packages/simd_x64-uwp/bin/Simd.dll * Update vcpkg.json * Update simd.json * Try ARM support, OSX not running Osx build failed, arm maybe supported * Update simd.json * Fix syntax error and optimize * Update simd.json * Fix syntax * Update simd.json * Added SIMD_TARGET="aarch64" * Update simd.json * Seperated arm64 cmake Check failes: #if defined(_MSC_VER) && !defined(__clang__) && (defined(SIMD_X64_ENABLE) || defined(SIMD_X86_ENABLE)) #define SIMD_INIT_AS_CHAR #elif defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && defined(SIMD_NEON_ENABLE)) #define SIMD_INIT_AS_LONGLONG #else #error This platform is unsupported! #endif * Update simd.json * Syntax Error * Update simd.json * Update to latest release 5.2.120 *fix bug: MSVS compiler bug (Windows, Arm64). commit b39197e00a902cbbc5ad397de92f086be994549b * Baseline Updates * Include arm64 fix * Update SHA512 * Update simd.json * Arm64 with msvc compiler not supported * Update simd.json * Updated supports field * Baseline update * Update ci.baseline.txt * Github action fix Replaced vcpkg_configure_cmake by vcpkg_cmake_configure * Update simd.json Co-authored-by: dtmen <dtmen@gmx.de>
2022-12-14 08:36:18 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ermig1979/Simd
REF "v${VERSION}"
SHA512 33521f493f59e7d0a82d4307cd0178e45cd47a2daa768430190789b601a8b214b7e4d9ca0c8116a6190c804854a3bca8c7e4048b6d8e1c288d8c58f27aa2b476
[simd] Add new port (#28163) * Added new port for Simd Created new port for Simd from https://github.com/ermig1979/Simd * Added new port for Simd Created/updated new port for Simd from https://github.com/ermig1979/Simd * Revert "Merge branch 'master' of https://github.com/erdogan61/vcpkg" This reverts commit 789c93e81a6ea996649e314eca852180035361ef, reversing changes made to c87a8183bd518b77b4092bfc27d24ad35686d4d7. * portfile.cmake fixes Update x64-windows-static* and fixes * Update simd.json * Added missing define Set "#define in SIMD_STATIC/src/Simd/SimdConfig.h" * Update simd.json * Update simd.json * Revert "Revert "Merge branch 'master' of https://github.com/erdogan61/vcpkg"" This reverts commit a97bdb05f4cd0590002ca953fbd158cab8db045c. * Added Linux support * Update simd.json * Added Cmake install patch Otherwise build error: "ninja: error: unknown target 'install'" * Update simd.json * Added supports in vcpkg.json * Update simd.json * Removed unsupported builds * x64_uwp failes UWP builds are failing, since not supported, Reason: The following DLLs do not have the App Container bit set: D:/packages/simd_x64-uwp/debug/bin/Simd.dll D:/packages/simd_x64-uwp/bin/Simd.dll * Update vcpkg.json * Update simd.json * Try ARM support, OSX not running Osx build failed, arm maybe supported * Update simd.json * Fix syntax error and optimize * Update simd.json * Fix syntax * Update simd.json * Added SIMD_TARGET="aarch64" * Update simd.json * Seperated arm64 cmake Check failes: #if defined(_MSC_VER) && !defined(__clang__) && (defined(SIMD_X64_ENABLE) || defined(SIMD_X86_ENABLE)) #define SIMD_INIT_AS_CHAR #elif defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && defined(SIMD_NEON_ENABLE)) #define SIMD_INIT_AS_LONGLONG #else #error This platform is unsupported! #endif * Update simd.json * Syntax Error * Update simd.json * Update to latest release 5.2.120 *fix bug: MSVS compiler bug (Windows, Arm64). commit b39197e00a902cbbc5ad397de92f086be994549b * Baseline Updates * Include arm64 fix * Update SHA512 * Update simd.json * Arm64 with msvc compiler not supported * Update simd.json * Updated supports field * Baseline update * Update ci.baseline.txt * Github action fix Replaced vcpkg_configure_cmake by vcpkg_cmake_configure * Update simd.json Co-authored-by: dtmen <dtmen@gmx.de>
2022-12-14 08:36:18 +08:00
HEAD_REF master
)
if(VCPKG_TARGET_IS_WINDOWS AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64"))
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(SIMD_PLATFORM "Win32")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(SIMD_PLATFORM "x64")
endif()
if(VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(SOLUTION_TYPE vs2015)
elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(SOLUTION_TYPE vs2017)
elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v142")
set(SOLUTION_TYPE vs2019)
else()
set(SOLUTION_TYPE vs2022)
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${SOURCE_PATH}/src/Simd/SimdConfig.h"
"//#define SIMD_STATIC"
"#define SIMD_STATIC")
vcpkg_replace_string("${SOURCE_PATH}/prj/${SOLUTION_TYPE}/Simd.vcxproj"
"<ConfigurationType>DynamicLibrary</ConfigurationType>"
"<ConfigurationType>StaticLibrary</ConfigurationType>")
file(GLOB_RECURSE PROJ_FILES "${SOURCE_PATH}/prj/${SOLUTION_TYPE}/*.vcxproj")
foreach(PROJ_FILE ${PROJ_FILES})
vcpkg_replace_string(${PROJ_FILE}
" </ClCompile>"
" <DebugInformationFormat>OldStyle</DebugInformationFormat>\n </ClCompile>")
endforeach()
[simd] Add new port (#28163) * Added new port for Simd Created new port for Simd from https://github.com/ermig1979/Simd * Added new port for Simd Created/updated new port for Simd from https://github.com/ermig1979/Simd * Revert "Merge branch 'master' of https://github.com/erdogan61/vcpkg" This reverts commit 789c93e81a6ea996649e314eca852180035361ef, reversing changes made to c87a8183bd518b77b4092bfc27d24ad35686d4d7. * portfile.cmake fixes Update x64-windows-static* and fixes * Update simd.json * Added missing define Set "#define in SIMD_STATIC/src/Simd/SimdConfig.h" * Update simd.json * Update simd.json * Revert "Revert "Merge branch 'master' of https://github.com/erdogan61/vcpkg"" This reverts commit a97bdb05f4cd0590002ca953fbd158cab8db045c. * Added Linux support * Update simd.json * Added Cmake install patch Otherwise build error: "ninja: error: unknown target 'install'" * Update simd.json * Added supports in vcpkg.json * Update simd.json * Removed unsupported builds * x64_uwp failes UWP builds are failing, since not supported, Reason: The following DLLs do not have the App Container bit set: D:/packages/simd_x64-uwp/debug/bin/Simd.dll D:/packages/simd_x64-uwp/bin/Simd.dll * Update vcpkg.json * Update simd.json * Try ARM support, OSX not running Osx build failed, arm maybe supported * Update simd.json * Fix syntax error and optimize * Update simd.json * Fix syntax * Update simd.json * Added SIMD_TARGET="aarch64" * Update simd.json * Seperated arm64 cmake Check failes: #if defined(_MSC_VER) && !defined(__clang__) && (defined(SIMD_X64_ENABLE) || defined(SIMD_X86_ENABLE)) #define SIMD_INIT_AS_CHAR #elif defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && defined(SIMD_NEON_ENABLE)) #define SIMD_INIT_AS_LONGLONG #else #error This platform is unsupported! #endif * Update simd.json * Syntax Error * Update simd.json * Update to latest release 5.2.120 *fix bug: MSVS compiler bug (Windows, Arm64). commit b39197e00a902cbbc5ad397de92f086be994549b * Baseline Updates * Include arm64 fix * Update SHA512 * Update simd.json * Arm64 with msvc compiler not supported * Update simd.json * Updated supports field * Baseline update * Update ci.baseline.txt * Github action fix Replaced vcpkg_configure_cmake by vcpkg_cmake_configure * Update simd.json Co-authored-by: dtmen <dtmen@gmx.de>
2022-12-14 08:36:18 +08:00
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
file(GLOB_RECURSE PROJ_FILES "${SOURCE_PATH}/prj/${SOLUTION_TYPE}/*.vcxproj")
foreach(PROJ_FILE ${PROJ_FILES})
vcpkg_replace_string(${PROJ_FILE}
" </ClCompile>"
" <RuntimeLibrary Condition=\"'$(Configuration)'=='Debug'\">MultiThreadedDebugDLL</RuntimeLibrary>\n <RuntimeLibrary Condition=\"'$(Configuration)'=='Release'\">MultiThreadedDLL</RuntimeLibrary>\n </ClCompile>")
endforeach()
endif()
endif()
vcpkg_install_msbuild(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH "/prj/${SOLUTION_TYPE}/Simd.sln"
PLATFORM ${SIMD_PLATFORM}
TARGET Simd
RELEASE_CONFIGURATION "Release"
DEBUG_CONFIGURATION "Debug"
)
vcpkg_copy_pdbs()
file(GLOB SIMD_HEADERS "${SOURCE_PATH}/src/Simd/*.hpp" "${SOURCE_PATH}/src/Simd/*.h")
file(COPY ${SIMD_HEADERS} DESTINATION "${CURRENT_PACKAGES_DIR}/include/Simd")
[simd] Add new port (#28163) * Added new port for Simd Created new port for Simd from https://github.com/ermig1979/Simd * Added new port for Simd Created/updated new port for Simd from https://github.com/ermig1979/Simd * Revert "Merge branch 'master' of https://github.com/erdogan61/vcpkg" This reverts commit 789c93e81a6ea996649e314eca852180035361ef, reversing changes made to c87a8183bd518b77b4092bfc27d24ad35686d4d7. * portfile.cmake fixes Update x64-windows-static* and fixes * Update simd.json * Added missing define Set "#define in SIMD_STATIC/src/Simd/SimdConfig.h" * Update simd.json * Update simd.json * Revert "Revert "Merge branch 'master' of https://github.com/erdogan61/vcpkg"" This reverts commit a97bdb05f4cd0590002ca953fbd158cab8db045c. * Added Linux support * Update simd.json * Added Cmake install patch Otherwise build error: "ninja: error: unknown target 'install'" * Update simd.json * Added supports in vcpkg.json * Update simd.json * Removed unsupported builds * x64_uwp failes UWP builds are failing, since not supported, Reason: The following DLLs do not have the App Container bit set: D:/packages/simd_x64-uwp/debug/bin/Simd.dll D:/packages/simd_x64-uwp/bin/Simd.dll * Update vcpkg.json * Update simd.json * Try ARM support, OSX not running Osx build failed, arm maybe supported * Update simd.json * Fix syntax error and optimize * Update simd.json * Fix syntax * Update simd.json * Added SIMD_TARGET="aarch64" * Update simd.json * Seperated arm64 cmake Check failes: #if defined(_MSC_VER) && !defined(__clang__) && (defined(SIMD_X64_ENABLE) || defined(SIMD_X86_ENABLE)) #define SIMD_INIT_AS_CHAR #elif defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && defined(SIMD_NEON_ENABLE)) #define SIMD_INIT_AS_LONGLONG #else #error This platform is unsupported! #endif * Update simd.json * Syntax Error * Update simd.json * Update to latest release 5.2.120 *fix bug: MSVS compiler bug (Windows, Arm64). commit b39197e00a902cbbc5ad397de92f086be994549b * Baseline Updates * Include arm64 fix * Update SHA512 * Update simd.json * Arm64 with msvc compiler not supported * Update simd.json * Updated supports field * Baseline update * Update ci.baseline.txt * Github action fix Replaced vcpkg_configure_cmake by vcpkg_cmake_configure * Update simd.json Co-authored-by: dtmen <dtmen@gmx.de>
2022-12-14 08:36:18 +08:00
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message(FATAL_ERROR "Arm64 building with MSVC is currently not supported.")
else()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/prj/cmake"
OPTIONS
-DSIMD_TARGET="aarch64"
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
endif()
else()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/prj/cmake"
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
endif()
# Handle copyright
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")