Finn Williams | 2ed809c | 2020-04-20 21:21:07 +0100 | [diff] [blame] | 1 | # |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 2 | # Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
Finn Williams | 2ed809c | 2020-04-20 21:21:07 +0100 | [diff] [blame] | 3 | # SPDX-License-Identifier: MIT |
| 4 | # |
| 5 | |
| 6 | if(BUILD_BASE_PIPE_SERVER) |
| 7 | set(BasePipeServer_sources) |
| 8 | list(APPEND BasePipeServer_sources |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 9 | BasePipeServer.cpp) |
| 10 | |
| 11 | if(NOT "${TOOLCHAIN_PREFIX}" STREQUAL x86_64-w64-mingw32) |
| 12 | list(APPEND BasePipeServer_sources |
| 13 | ConnectionHandler.cpp) |
| 14 | endif() |
Finn Williams | 2ed809c | 2020-04-20 21:21:07 +0100 | [diff] [blame] | 15 | |
Finn Williams | 0c8cb99 | 2020-05-07 10:38:15 +0100 | [diff] [blame] | 16 | include_directories(${PROJECT_SOURCE_DIR}/profiling/common/include) |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 17 | include_directories(${PROJECT_SOURCE_DIR}/profiling/server/include/basePipeServer) |
Finn Williams | 0c8cb99 | 2020-05-07 10:38:15 +0100 | [diff] [blame] | 18 | |
| 19 | if (BUILD_UNIT_TESTS) |
| 20 | target_include_directories(UnitTests PRIVATE ${PROJECT_SOURCE_DIR}/profiling/server/src/basePipeServer) |
| 21 | target_include_directories(UnitTests PUBLIC ${PROJECT_SOURCE_DIR}/profiling/common/include) |
| 22 | endif() |
Finn Williams | 2ed809c | 2020-04-20 21:21:07 +0100 | [diff] [blame] | 23 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 24 | if (BUILD_STATIC_PIPE_LIBS) |
| 25 | add_library_ex(armnnBasePipeServer STATIC ${BasePipeServer_sources}) |
| 26 | target_link_libraries(armnnBasePipeServer pipeCommon) |
Finn Williams | 0c8cb99 | 2020-05-07 10:38:15 +0100 | [diff] [blame] | 27 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 28 | if ("${CMAKE_SYSTEM_NAME}" STREQUAL Windows) |
| 29 | target_link_libraries(armnnBasePipeServer ws2_32.lib) |
| 30 | endif() |
| 31 | else() |
| 32 | add_library_ex(armnnBasePipeServer SHARED ${BasePipeServer_sources}) |
| 33 | target_link_libraries(armnnBasePipeServer pipeCommon) |
Finn Williams | 2ed809c | 2020-04-20 21:21:07 +0100 | [diff] [blame] | 34 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 35 | if ("${CMAKE_SYSTEM_NAME}" STREQUAL Windows) |
| 36 | target_link_libraries(armnnBasePipeServer ws2_32.lib) |
| 37 | endif() |
Rob Hughes | bc873d2 | 2020-05-20 13:11:37 +0100 | [diff] [blame] | 38 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 39 | set_target_properties(armnnBasePipeServer PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) |
| 40 | set_target_properties(armnnBasePipeServer PROPERTIES VERSION ${GENERIC_LIB_VERSION} |
| 41 | SOVERSION ${GENERIC_LIB_SOVERSION}) |
Rob Hughes | b98032f | 2020-04-24 11:41:34 +0100 | [diff] [blame] | 42 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 43 | target_include_directories(armnnBasePipeServer PRIVATE ${PROJECT_SOURCE_DIR}/src/armnnUtils) |
| 44 | |
| 45 | install(TARGETS armnnBasePipeServer |
| 46 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 47 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
| 48 | endif() |
| 49 | endif() |