Explicitly link against needed Nix libraries to fix compilation on Mac

dblsaiko
Mar 30, 2024, 5:23 PM
KAVSKDAYPOF2HSPIC57APDDJSJQ2CMZIMQXAB2CVQPUXP4PNULMQC

Dependencies

  • [2] 7YS2X7JJ Fix compilation against older Nix versions (tested with 2.13.6)
  • [3] 3KEFKH5F Import existing code
  • [4] UZYI7CB2 Fix compile errors on macOS in dev shell

Change contents

  • replacement in CMakeLists.txt at line 23
    [3.14277][3.14277:14334]()
    pkg_check_modules(Nix REQUIRED IMPORTED_TARGET nix-main)
    [3.14277]
    [3.14334]
    pkg_check_modules(Nix REQUIRED IMPORTED_TARGET nix-main nix-store)
    find_library(nixfetchers_LIBRARY nixfetchers REQUIRED)
    target_link_libraries(PkgConfig::Nix INTERFACE ${nixfetchers_LIBRARY})
  • edit in CMakeLists.txt at line 27
    [3.14335]
    [2.168]
    set(Nix_VERSION ${Nix_nix-main_VERSION})