[build] make "common" a static library (part 1/2)

This commit is contained in:
Geoffrey McRae
2019-04-11 11:03:30 +10:00
parent bee221c18d
commit 28b12c85f4
22 changed files with 60 additions and 35 deletions

View File

@@ -33,12 +33,12 @@ execute_process(
)
add_definitions(-D BUILD_VERSION='"${BUILD_VERSION}"')
get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/.." ABSOLUTE)
include_directories(
${PROJECT_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/../common
${PROJECT_SOURCE_DIR}/../vendor/kvm-guest-drivers-windows
${PROJECT_TOP}/vendor/kvm-guest-drivers-windows
${PKGCONFIG_INCLUDE_DIRS}
${GMP_INCLUDE_DIR}
)
@@ -50,6 +50,7 @@ set(SOURCES
src/app.c
)
add_subdirectory("${PROJECT_TOP}/common" "${CMAKE_BINARY_DIR}/common")
add_subdirectory(platform)
if(WIN32)
@@ -58,6 +59,7 @@ else()
add_executable(looking-glass-host ${SOURCES})
endif()
target_link_libraries(looking-glass-host
lg_common
platform
)
set_target_properties(looking-glass-host PROPERTIES LINK_FLAGS "-Wl,--gc-sections")