Merge pull request #357 from HeinrichJanzing/cmake_optional_objects_target
CMake: allow disabling the intermediate objects target (cryptopp-object).pull/363/head
commit
89facf5599
|
|
@ -35,6 +35,12 @@ option(BUILD_STATIC "Build static library" ON)
|
|||
option(BUILD_SHARED "Build shared library" ON)
|
||||
option(BUILD_TESTING "Build library tests" ON)
|
||||
option(BUILD_DOCUMENTATION "Use Doxygen to create the HTML based API documentation" OFF)
|
||||
option(USE_INTERMEDIATE_OBJECTS_TARGET "Use a common intermediate objects target for the static and shared library targets" ON)
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 2.8.8 AND USE_INTERMEDIATE_OBJECTS_TARGET)
|
||||
message(STATUS "Forcing USE_INTERMEDIATE_OBJECTS_TARGET to OFF - requires CMake >= 2.8.8")
|
||||
set(USE_INTERMEDIATE_OBJECTS_TARGET OFF CACHE BOOL "Use a common intermediate objects target for the static and shared library targets" FORCE)
|
||||
endif()
|
||||
|
||||
option(DISABLE_ASM "Disable ASM" OFF)
|
||||
option(DISABLE_SSSE3 "Disable SSSE3" OFF)
|
||||
|
|
@ -237,12 +243,12 @@ if(CMAKE_VERSION VERSION_LESS 2.8.12)
|
|||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 2.8.8)
|
||||
if(USE_INTERMEDIATE_OBJECTS_TARGET)
|
||||
add_library(cryptopp-object OBJECT ${cryptopp_SOURCES})
|
||||
endif()
|
||||
|
||||
if (BUILD_STATIC)
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 2.8.8)
|
||||
if(USE_INTERMEDIATE_OBJECTS_TARGET)
|
||||
add_library(cryptopp-static STATIC $<TARGET_OBJECTS:cryptopp-object>)
|
||||
else()
|
||||
add_library(cryptopp-static STATIC ${cryptopp_SOURCES})
|
||||
|
|
@ -254,7 +260,7 @@ if (BUILD_STATIC)
|
|||
endif()
|
||||
|
||||
if (BUILD_SHARED)
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 2.8.8)
|
||||
if(USE_INTERMEDIATE_OBJECTS_TARGET)
|
||||
add_library(cryptopp-shared SHARED $<TARGET_OBJECTS:cryptopp-object>)
|
||||
else()
|
||||
add_library(cryptopp-shared SHARED ${cryptopp_SOURCES})
|
||||
|
|
|
|||
Loading…
Reference in New Issue