CMake: link in ws2_32 on windows

This commit is contained in:
nick black 2021-07-22 22:58:43 -04:00
parent dd9e5bc312
commit e5d77037dc
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 5 additions and 3 deletions

View File

@ -83,9 +83,11 @@ set_package_properties(Threads PROPERTIES TYPE REQUIRED)
find_package(ZLIB)
set_package_properties(ZLIB PROPERTIES TYPE REQUIRED)
# platform-specific logics
if(NOT MSYS AND NOT WIN32 AND NOT APPLE)
if(NOT MSYS AND NOT APPLE)
find_library(LIBM m REQUIRED)
find_library(LIBRT rt REQUIRED)
elseif(MSYS)
find_library(LIBRT ws2_32 REQUIRED)
endif()
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
include_directories(/usr/local/include)

View File

@ -69,8 +69,8 @@ auto main(int argc, const char** argv) -> int {
int tgeomy, tgeomx, vgeomy, vgeomx;
ncplane_dim_yx(tplane, &tgeomy, &tgeomx);
ncplane_dim_yx(ncp, &vgeomy, &vgeomx);
(*n)->printf(0, 0, "Scroll: %lc Cursor: %03d/%03d Viewgeom: %03d/%03d Textgeom: %03d/%03d",
horscroll ? L'' : L'🗴', ncpy, ncpx, vgeomy, vgeomx, tgeomy, tgeomx);
(*n)->printf(0, 0, "Scroll: %c Cursor: %03d/%03d Viewgeom: %03d/%03d Textgeom: %03d/%03d",
horscroll ? '+' : '-', ncpy, ncpx, vgeomy, vgeomx, tgeomy, tgeomx);
nc.render();
}
}