Unverified Commit 41eb4eaf by sterin Committed by GitHub

Merge pull request #3 from kmurray/fix_cmake_libabc_dependency

CMake: Ensure abc executable depends on libabc
parents a2d59be3 c3be5dc6
...@@ -88,15 +88,17 @@ function(abc_properties target visibility) ...@@ -88,15 +88,17 @@ function(abc_properties target visibility)
target_link_libraries(${target} ${visibility} ${ABC_LIBS}) target_link_libraries(${target} ${visibility} ${ABC_LIBS})
endfunction() endfunction()
add_executable(abc ${ABC_SRC}) set(ABC_MAIN_SRC src/base/main/main.c)
abc_properties(abc PRIVATE) list(REMOVE_ITEM ABC_SRC ${ABC_MAIN_SRC})
list(REMOVE_ITEM ABC_SRC src/base/main/main.c)
add_library(libabc EXCLUDE_FROM_ALL ${ABC_SRC}) add_library(libabc EXCLUDE_FROM_ALL ${ABC_SRC})
abc_properties(libabc PUBLIC) abc_properties(libabc PUBLIC)
set_property(TARGET libabc PROPERTY OUTPUT_NAME abc) set_property(TARGET libabc PROPERTY OUTPUT_NAME abc)
add_executable(abc ${ABC_MAIN_SRC})
target_link_libraries(abc PRIVATE libabc)
abc_properties(abc PRIVATE)
add_library(libabc-pic EXCLUDE_FROM_ALL ${ABC_SRC}) add_library(libabc-pic EXCLUDE_FROM_ALL ${ABC_SRC})
abc_properties(libabc-pic PUBLIC) abc_properties(libabc-pic PUBLIC)
set_property(TARGET libabc-pic PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET libabc-pic PROPERTY POSITION_INDEPENDENT_CODE ON)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment