cmake: fix some issues when building both shared and static versions of a library
This commit is contained in:
@@ -63,6 +63,7 @@ function(rosetta_add_library)
|
|||||||
add_library(${static_lib_name} STATIC
|
add_library(${static_lib_name} STATIC
|
||||||
${arg_SOURCES}
|
${arg_SOURCES}
|
||||||
${arg_HEADERS})
|
${arg_HEADERS})
|
||||||
|
set_target_properties(${static_lib_name} PROPERTIES OUTPUT_NAME "${lib_name}")
|
||||||
set(targets ${targets} ${static_lib_name})
|
set(targets ${targets} ${static_lib_name})
|
||||||
|
|
||||||
if (arg_PUBLIC_INCLUDE_DIRS)
|
if (arg_PUBLIC_INCLUDE_DIRS)
|
||||||
@@ -90,7 +91,10 @@ function(rosetta_add_library)
|
|||||||
target_link_options(${shared_lib_name} PRIVATE -Wl,--soname,${soname})
|
target_link_options(${shared_lib_name} PRIVATE -Wl,--soname,${soname})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(${targets} PUBLIC ${arg_PUBLIC_INCLUDE_DIRS})
|
foreach (target ${targets})
|
||||||
|
target_include_directories(${target} PUBLIC ${arg_PUBLIC_INCLUDE_DIRS})
|
||||||
|
endforeach (target)
|
||||||
|
|
||||||
set_target_properties(${targets} PROPERTIES
|
set_target_properties(${targets} PROPERTIES
|
||||||
POSITION_INDEPENDENT_CODE ON
|
POSITION_INDEPENDENT_CODE ON
|
||||||
src_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/include
|
src_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
|
|||||||
Reference in New Issue
Block a user