[CMake] need COMPATSRC for static targets #2454

This commit is contained in:
nick black 2021-12-12 03:28:37 -05:00
parent b77dedd791
commit d25c9a297c
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -211,9 +211,9 @@ file(GLOB COMPATSRC CONFIGURE_DEPENDS src/compat/*.c)
file(GLOB NCCORESRCS CONFIGURE_DEPENDS src/lib/*.c src/lib/*.cpp) file(GLOB NCCORESRCS CONFIGURE_DEPENDS src/lib/*.c src/lib/*.cpp)
add_library(notcurses-core SHARED ${NCCORESRCS} ${COMPATSRC}) add_library(notcurses-core SHARED ${NCCORESRCS} ${COMPATSRC})
if(${USE_STATIC}) if(${USE_STATIC})
add_library(notcurses-core-static STATIC ${NCCORESRCS}) add_library(notcurses-core-static STATIC ${NCCORESRCS} ${COMPATSRC})
else() else()
add_library(notcurses-core-static STATIC EXCLUDE_FROM_ALL ${NCCORESRCS}) add_library(notcurses-core-static STATIC EXCLUDE_FROM_ALL ${NCCORESRCS} ${COMPATSRC})
endif() endif()
# don't want these on freebsd/dragonfly/osx # don't want these on freebsd/dragonfly/osx
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
@ -266,7 +266,6 @@ target_link_libraries(notcurses-core
"${ZLIB_LIBRARIES}" "${ZLIB_LIBRARIES}"
"${TERMINFO_LIBRARIES}" "${TERMINFO_LIBRARIES}"
"${LIBM}" "${LIBM}"
"${LIBRT}"
"${unistring}" "${unistring}"
"${gpm}" "${gpm}"
PUBLIC PUBLIC
@ -279,10 +278,8 @@ target_link_libraries(notcurses-core-static
"${ZLIB_STATIC_LIBRARIES}" "${ZLIB_STATIC_LIBRARIES}"
"${TERMINFO_STATIC_LIBRARIES}" "${TERMINFO_STATIC_LIBRARIES}"
"${LIBM}" "${LIBM}"
"${LIBRT}"
"${unistring}" "${unistring}"
"${gpm}" "${gpm}"
PUBLIC
Threads::Threads Threads::Threads
"${LIBRT_LIBRARIES}" "${LIBRT_LIBRARIES}"
) )
@ -308,9 +305,9 @@ endif()
file(GLOB NCSRCS CONFIGURE_DEPENDS src/media/*.c src/media/*.cpp) file(GLOB NCSRCS CONFIGURE_DEPENDS src/media/*.c src/media/*.cpp)
add_library(notcurses SHARED ${NCSRCS} ${COMPATSRC}) add_library(notcurses SHARED ${NCSRCS} ${COMPATSRC})
if(${USE_STATIC}) if(${USE_STATIC})
add_library(notcurses-static STATIC ${NCSRCS}) add_library(notcurses-static STATIC ${NCSRCS} ${COMPATSRC})
else() else()
add_library(notcurses-static STATIC EXCLUDE_FROM_ALL ${NCSRCS}) add_library(notcurses-static STATIC EXCLUDE_FROM_ALL ${NCSRCS} ${COMPATSRC})
endif() endif()
set_target_properties(notcurses PROPERTIES set_target_properties(notcurses PROPERTIES
VERSION ${PROJECT_VERSION} VERSION ${PROJECT_VERSION}