Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to libncursesw in CMake #55054

Merged
merged 1 commit into from
Feb 4, 2022

Conversation

BrettDong
Copy link
Member

Summary

Build "Link to libncursesw in CMake"

Purpose of change

Recently added widget test (#54050) uses mvwinnwstr() library function that is only available in libncursesw (wide version). However, current CMake build script links to libncurses (non-wide version) and causes build error on LGTM.com:

widget_test.cpp:(.text+0x4e5): undefined reference to `mvwinnwstr'
collect2: error: ld returned 1 exit status

Describe the solution

CMake added ncursesw detection support in CMake 3.10: Kitware/CMake@4b02afc .

Pull the new FindCurses.cmake with libncursesw support from upstream CMake repository.

Describe alternatives you've considered

Testing

Compile with CMake:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..

And verify the compiled executable depends on wide version of libncursesw:

ldd ./src/cataclysm
        linux-vdso.so.1 (0x00007ffca4917000)
        libncursesw.so.6 => /lib/x86_64-linux-gnu/libncursesw.so.6 (0x00007fd24f1db000)
        libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fd24f1ab000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd24f18f000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd24f16c000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd24ef8a000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd24ee3b000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd24ee1e000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd24ec2c000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd24ec26000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd251b3b000)

Additional context

@BrettDong BrettDong added the Code: Build Issues regarding different builds and build environments label Feb 3, 2022
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 3, 2022
@kevingranade kevingranade merged commit d489019 into CleverRaven:master Feb 4, 2022
@BrettDong BrettDong deleted the cmake-ncursesw branch February 4, 2022 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions Code: Build Issues regarding different builds and build environments json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cmake] FindCurses.cmake ignores CURSES_NEED_WIDE , can't compile with ncursesw
2 participants