cmake: define BUILD_STATIC and BUILD_SHARED for library builds
This commit is contained in:
@@ -64,6 +64,8 @@ function(rosetta_add_library)
|
||||
${arg_SOURCES}
|
||||
${arg_HEADERS})
|
||||
set_target_properties(${static_lib_name} PROPERTIES OUTPUT_NAME "${lib_name}")
|
||||
target_compile_definitions(${static_lib_name} PRIVATE
|
||||
BUILD_STATIC=1)
|
||||
set(targets ${targets} ${static_lib_name})
|
||||
|
||||
if (arg_PUBLIC_INCLUDE_DIRS)
|
||||
@@ -86,6 +88,8 @@ function(rosetta_add_library)
|
||||
PATH ${arg_PUBLIC_INCLUDE_DIRS})
|
||||
endif ()
|
||||
|
||||
target_compile_definitions(${shared_lib_name} PRIVATE
|
||||
BUILD_SHARED=1)
|
||||
set_target_properties(${shared_lib_name} PROPERTIES
|
||||
SOVERSION 1)
|
||||
target_link_options(${shared_lib_name} PRIVATE -Wl,--soname,${soname})
|
||||
|
||||
Reference in New Issue
Block a user