Commit 38cbcdc8 authored by Philip Quinn's avatar Philip Quinn

Specify/fix library dependencies.

parent 7fae9544
project("Cap'n Proto" CXX) project("Cap'n Proto" CXX)
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -std=c++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -std=c++11 -pthread")
add_subdirectory(src) add_subdirectory(src)
...@@ -52,6 +52,7 @@ add_library(kj-async ...@@ -52,6 +52,7 @@ add_library(kj-async
kj/async-unix.c++ kj/async-unix.c++
kj/async-io.c++ kj/async-io.c++
) )
target_link_libraries(kj-async kj)
set(kj-async_headers set(kj-async_headers
kj/async-prelude.h kj/async-prelude.h
kj/async.h kj/async.h
...@@ -78,6 +79,7 @@ add_library(capnp ...@@ -78,6 +79,7 @@ add_library(capnp
capnp/serialize.c++ capnp/serialize.c++
capnp/serialize-packed.c++ capnp/serialize-packed.c++
) )
target_link_libraries(capnp kj)
set(capnp_headers set(capnp_headers
capnp/c++.capnp.h capnp/c++.capnp.h
capnp/common.h capnp/common.h
...@@ -112,6 +114,7 @@ add_library(capnp-rpc ...@@ -112,6 +114,7 @@ add_library(capnp-rpc
capnp/rpc-twoparty.capnp.c++ capnp/rpc-twoparty.capnp.c++
capnp/ez-rpc.c++ capnp/ez-rpc.c++
) )
target_link_libraries(capnp-rpc kj-async kj)
set(capnp-rpc_headers set(capnp-rpc_headers
capnp/rpc-prelude.h capnp/rpc-prelude.h
capnp/rpc.h capnp/rpc.h
...@@ -134,6 +137,7 @@ add_library(capnpc ...@@ -134,6 +137,7 @@ add_library(capnpc
capnp/compiler/compiler.c++ capnp/compiler/compiler.c++
capnp/schema-parser.c++ capnp/schema-parser.c++
) )
target_link_libraries(capnpc capnp kj)
set(capnpc_headers set(capnpc_headers
capnp/c++.capnp capnp/c++.capnp
capnp/schema.capnp capnp/schema.capnp
...@@ -249,7 +253,6 @@ add_custom_command( ...@@ -249,7 +253,6 @@ add_custom_command(
DEPENDS capnp-tool capnpc_cpp ${test_capnp_files} DEPENDS capnp-tool capnpc_cpp ${test_capnp_files}
) )
add_library(capnp_test_lib ${test_capnp_cpp_files} ${test_capnp_header_files})
include_directories(${test_capnp_output_dir}) include_directories(${test_capnp_output_dir})
...@@ -300,9 +303,9 @@ add_executable(capnp-tests ...@@ -300,9 +303,9 @@ add_executable(capnp-tests
capnp/test-util.c++ capnp/test-util.c++
capnp/compiler/lexer-test.c++ capnp/compiler/lexer-test.c++
capnp/compiler/md5-test.c++ capnp/compiler/md5-test.c++
${test_capnp_cpp_files}
) )
target_link_libraries(capnp-tests target_link_libraries(capnp-tests
capnp_test_lib
capnpc capnpc
capnp-rpc capnp-rpc
capnp capnp
...@@ -313,16 +316,7 @@ target_link_libraries(capnp-tests ...@@ -313,16 +316,7 @@ target_link_libraries(capnp-tests
) )
add_executable(capnp-evolution-tests capnp/compiler/evolution-test.c++) add_executable(capnp-evolution-tests capnp/compiler/evolution-test.c++)
target_link_libraries(capnp-evolution-tests target_link_libraries(capnp-evolution-tests capnpc capnp kj)
capnp_test_lib
capnpc
capnp-rpc
capnp
kj-async
kj
gtest
gtest_main
)
include(CTest) include(CTest)
add_test(NAME capnp-tests-run COMMAND capnp-tests) add_test(NAME capnp-tests-run COMMAND capnp-tests)
......
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