Skip to content

Commit

Permalink
[CMake] need COMPATSRC for static targets #2454
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Dec 12, 2021
1 parent b77dedd commit d25c9a2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ file(GLOB COMPATSRC CONFIGURE_DEPENDS src/compat/*.c)
file(GLOB NCCORESRCS CONFIGURE_DEPENDS src/lib/*.c src/lib/*.cpp)
add_library(notcurses-core SHARED ${NCCORESRCS} ${COMPATSRC})
if(${USE_STATIC})
add_library(notcurses-core-static STATIC ${NCCORESRCS})
add_library(notcurses-core-static STATIC ${NCCORESRCS} ${COMPATSRC})
else()
add_library(notcurses-core-static STATIC EXCLUDE_FROM_ALL ${NCCORESRCS})
add_library(notcurses-core-static STATIC EXCLUDE_FROM_ALL ${NCCORESRCS} ${COMPATSRC})
endif()
# don't want these on freebsd/dragonfly/osx
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
Expand Down Expand Up @@ -266,7 +266,6 @@ target_link_libraries(notcurses-core
"${ZLIB_LIBRARIES}"
"${TERMINFO_LIBRARIES}"
"${LIBM}"
"${LIBRT}"
"${unistring}"
"${gpm}"
PUBLIC
Expand All @@ -279,10 +278,8 @@ target_link_libraries(notcurses-core-static
"${ZLIB_STATIC_LIBRARIES}"
"${TERMINFO_STATIC_LIBRARIES}"
"${LIBM}"
"${LIBRT}"
"${unistring}"
"${gpm}"
PUBLIC
Threads::Threads
"${LIBRT_LIBRARIES}"
)
Expand All @@ -308,9 +305,9 @@ endif()
file(GLOB NCSRCS CONFIGURE_DEPENDS src/media/*.c src/media/*.cpp)
add_library(notcurses SHARED ${NCSRCS} ${COMPATSRC})
if(${USE_STATIC})
add_library(notcurses-static STATIC ${NCSRCS})
add_library(notcurses-static STATIC ${NCSRCS} ${COMPATSRC})
else()
add_library(notcurses-static STATIC EXCLUDE_FROM_ALL ${NCSRCS})
add_library(notcurses-static STATIC EXCLUDE_FROM_ALL ${NCSRCS} ${COMPATSRC})
endif()
set_target_properties(notcurses PROPERTIES
VERSION ${PROJECT_VERSION}
Expand Down

0 comments on commit d25c9a2

Please sign in to comment.