no message

master
caiyuzheng 2020-11-15 16:32:29 +08:00
parent 526c77dd0e
commit 5e65ec6a72
1 changed files with 14 additions and 11 deletions

View File

@ -6,6 +6,14 @@ message("current make is " ${CMAKE_MAKE_PROGRAM})
enable_language(CXX)
project(generallib)
add_subdirectory(general)
find_package(libevent REQUIRED)
set(EVENT__HAVE_LIBEVENT 1)
message(STATUS "libevent include: ${libevent_INCLUDE_DIR}")
message(STATUS "libevent lib: ${libevent_LIBRARIES}")
message(STATUS "libevent lib Dirs: ${libevent_LIB_DIRS}")
message(STATUS "library files : " $<TARGET_OBJECTS:General>
SET(SRC_SDK sdk_main.c test/src/heapsort/main.c)#
add_library(generallib STATIC $<TARGET_OBJECTS:General> ${SRC_SDK})
message("CMAKE_BINARY_DIR is " ${CMAKE_BINARY_DIR})
@ -17,12 +25,7 @@ target_link_libraries(generallib public
libevent.a
-Wl,--no-whole-archive
)
find_package(libevent REQUIRED)
set(EVENT__HAVE_LIBEVENT 1)
message(STATUS "libevent include: ${libevent_INCLUDE_DIR}")
message(STATUS "libevent lib: ${libevent_LIBRARIES}")
message(STATUS "libevent lib Dirs: ${libevent_LIB_DIRS}")
message("current path is" ${CMAKE_CURRENT_SOURCE_DIR})
IF (WIN32)
@ -30,12 +33,12 @@ IF (WIN32)
message("using clang")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message("using gcc")
#add_custom_command (
# TARGET generallib POST_BUILD
# COMMAND ar -x
# ${CMAKE_CURRENT_SOURCE_DIR}/libd/libevent.a
# COMMENT "package library ar -x ${CMAKE_CURRENT_SOURCE_DIR}/libd/libevent.a "
# )
add_custom_command (
TARGET generallib POST_BUILD
COMMAND ar -x
${CMAKE_CURRENT_SOURCE_DIR}/libd/libevent.a
COMMENT "package library ar -x ${CMAKE_CURRENT_SOURCE_DIR}/libd/libevent.a "
)
add_custom_command (
TARGET generallib POST_BUILD
COMMAND ar rc libgeneral.a *.obj