Skip to content

macOS 下 build 时出错 #24

@iCasture

Description

@iCasture

Hi,

目前的版本在 macOS 下,无论是仅安装 pypinyin 还是同时安装 pypinyin & cpp-pinyin,在 build 时都会报错:

pinyin.cc:33:10: fatal error: 'cpp-pinyin/G2pglobal.h' file not found
   33 | #include <cpp-pinyin/G2pglobal.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[3]: *** [pinyin..o] Error 1
make[2]: *** [modules] Error 1
make[1]: *** [modules] Error 2
make: *** [all] Error 2

cpp-pinyin 是通过 vcpkg 安装的:

$ vcpkg install cpp-pinyin

Computing installation plan...
The following packages are already installed:
    cpp-pinyin:arm64-osx@1.0.0
cpp-pinyin:arm64-osx is already installed
Total install time: 5.12 us
cpp-pinyin provides CMake targets:

  find_package(cpp-pinyin CONFIG REQUIRED)
  target_link_libraries(main PRIVATE cpp-pinyin::cpp-pinyin)

To use the library, you need to copy the dictionary files to the binary directory.

  add_custom_command(TARGET main POST_BUILD
      COMMAND "${CMAKE_COMMAND}" -E copy_directory
        "${cpp-pinyin_DIR}/dict"
        "$<TARGET_FILE_DIR:main>/dict"
  )

请问如何解决?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions