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