Skip to content

Instantly share code, notes, and snippets.

@UnaNancyOwen
Created January 9, 2024 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UnaNancyOwen/2b862eb77ae257f138e9feb1044a7295 to your computer and use it in GitHub Desktop.
Save UnaNancyOwen/2b862eb77ae257f138e9feb1044a7295 to your computer and use it in GitHub Desktop.
Building lz4 with Visual Studio

Building LZ4 v1.9.4 with Visual Studio

Download

  1. LZ4 v1.9.4(lz4-1.9.4.zip)をダウンロードしてファイルを解凍する。(C:\lz4-1.9.4)
    https://github.com/lz4/lz4/releases/tag/v1.9.4

  2. CMakeLists.txtをvcpkgからダウンロードする。(C:\lz4-1.9.4\CMakeLists.txt)
    https://github.com/microsoft/vcpkg/blob/master/ports/lz4/CMakeLists.txt

CMake

  1. ソースコードの入力先とソリューションファイルの出力先を指定する。

    • Where is the source code: C:\lz4-1.9.4
    • Where is build the binaries: C:\lz4-1.9.4\build
  2. [Configure]を押してターゲットとなるVisual Studioを選択する。

  3. 各種設定を行う。

    • CMAKE_CONFIGURATION_TYPES Release
    • CMAKE_INSTALL_PREFIX C:/Program Files/lz4 (or C:/Program Files (x86)/lz4)
  4. [Generate]を押してソリューションファイルを出力する。

Build

  1. Visual Studioを管理者権限で起動してLZ4のソリューションファイル(C:\lz4-1.9.4\build\lz4.sln)を開く。
    (Visual Studioを管理者権限で起動しないとINSTALLが失敗する。)

  2. LZ4をビルドする。(ALL_BUILD)

    1. ソリューションの構成(Release)を設定する。
    2. ソリューションエクスプローラーからALL_BUILDプロジェクトを選択する。
    3. [ビルド]>[ソリューションのビルド]を押してFLANNをビルドする。
  3. LZ4をインストールする。(INSTALL)

    1. ソリューションエクスプローラーからINSTALLプロジェクトを選択する。
    2. [ビルド]>[プロジェクトのみ]>[INSTALLのみをビルド]を押してFLANNをインストールする。
      CMAKE_INSTALL_PREFIXで指定した出力先へ必要なファイルがコピーされる。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment