Skip to content

Commit

Permalink
Merge pull request #27 from robxu9/master
Browse files Browse the repository at this point in the history
Add shared library support.
  • Loading branch information
halayli committed Jul 9, 2014
2 parents 7dc7279 + 3ee3dc8 commit b23a479
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@ project (lthread)
SET(CMAKE_BUILD_TYPE release)
SET (CMAKE_C_FLAGS_RELEASE "-Werror -g -Wall")

set(LTHREAD_VERSION_MAJOR 1)
set(LTHREAD_VERSION_MINOR 0)
set(LTHREAD_VERSION_PATCH 0)
set(LTHREAD_VERSION_STRING ${LTHREAD_VERSION_MAJOR}.${LTHREAD_VERSION_MINOR}.${LTHREAD_VERSION_PATCH})

set(lthread_files src/lthread.c src/lthread_socket.c
src/lthread_sched.c src/lthread_io.c
src/lthread_poller.c src/lthread_compute.c)

add_library(lthread ${lthread_files})
add_library(lthread_shared SHARED ${lthread_files})
set_target_properties(lthread_shared PROPERTIES OUTPUT_NAME lthread)
set_target_properties(lthread_shared PROPERTIES VERSION ${LTHREAD_VERSION_STRING}
SOVERSION ${LTHREAD_VERSION_MAJOR})

set_property(SOURCE ${lthread_files} PROPERTY COMPILE_FLAGS "-O2")

install(TARGETS lthread DESTINATION lib)
install(TARGETS lthread_shared DESTINATION lib)
install(FILES src/lthread.h DESTINATION include)

set(UNIT_TEST_PATH ${CMAKE_SOURCE_DIR}/tests)
Expand Down

0 comments on commit b23a479

Please sign in to comment.