cmake: add support for static build
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
file(GLOB_RECURSE common_sources *.c *.h include/ivy/*.h)
|
||||
|
||||
add_library(ivy-common SHARED ${common_sources})
|
||||
if (IVY_STATIC)
|
||||
add_library(ivy-common STATIC ${common_sources})
|
||||
else ()
|
||||
add_library(ivy-common SHARED ${common_sources})
|
||||
endif ()
|
||||
|
||||
target_include_directories(ivy-common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
||||
target_compile_definitions(ivy-common PRIVATE IVY_EXPORT=1)
|
||||
target_compile_definitions(ivy-common PRIVATE IVY_EXPORT=1 IVY_STATIC=${IVY_STATIC})
|
||||
Reference in New Issue
Block a user