Skip to content

Commit

Permalink
fix: Fixed library not able to make static lib
Browse files Browse the repository at this point in the history
  • Loading branch information
alinalihassan committed Aug 30, 2022
1 parent 94071d8 commit a13bf75
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,16 @@ set(COMMON_LIBS ${LLVM_LIBS} ${CLANG_LIBS} fmt nameof)

## Options
### Shared/Dynamic or Static library?
option(BUILD_SHARED_LIBS "Build libraries as shared as opposed to static" ON)
option(LESMA_BUILD_SHARED_LIBS "Build libraries as shared as opposed to static" ${BUILD_SHARED_LIB})

if (LESMA_BUILD_SHARED_LIBS)
set(LESMA_LIB_TYPE SHARED)
else()
set(LESMA_LIB_TYPE STATIC)
endif()

## Create Library
add_library(${LIB_NAME} ${COMMON_SOURCES})
add_library(${LIB_NAME} ${LESMA_LIB_TYPE} ${COMMON_SOURCES})
target_link_libraries(${LIB_NAME} ${COMMON_LIBS})

target_include_directories(${LIB_NAME} PUBLIC
Expand Down

0 comments on commit a13bf75

Please sign in to comment.