Skip to content

Commit

Permalink
Merge pull request KjellKod#47 from ctapmex/disable_shared
Browse files Browse the repository at this point in the history
add option ADD_BUILD_SHARED
  • Loading branch information
Kjell Hedstrom committed Sep 6, 2015
2 parents ef27722 + 0a04ae2 commit 70f6cc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,18 @@ ENDIF()
add_library(g3logger ${SRC_FILES})
set_target_properties(g3logger PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(g3logger ${PLATFORM_LINK_LIBRIES})
SET(G3LOG_LIBRARY g3logger)

if(ADD_BUILD_WIN_SHARED OR NOT(MSVC OR MINGW))
add_library(g3logger_shared SHARED ${SRC_FILES})
set_target_properties(g3logger_shared PROPERTIES LINKER_LANGUAGE CXX)
IF(APPLE)
set_target_properties(g3logger_shared PROPERTIES MACOSX_RPATH TRUE)
ENDIF(APPLE)
target_link_libraries(g3logger_shared ${PLATFORM_LINK_LIBRIES})

SET(G3LOG_SHARED_LIBRARY g3logger_shared)
SET(G3LOG_LIBRARY g3logger)
endif()



2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ endif()
#==========================================================================
INCLUDE (${g3log_SOURCE_DIR}/GenerateMacroDefinitionsFile.cmake)

option (ADD_BUILD_WIN_SHARED "Build shared library on Windows" OFF)

# =========================================================================
# G3LOG BUILD
#==========================================================================
Expand Down

0 comments on commit 70f6cc2

Please sign in to comment.