[client] project restructure part 1/2

This commit is contained in:
Geoffrey McRae
2019-03-28 11:02:36 +11:00
parent 7cbaf8b5be
commit db398d41a0
39 changed files with 164 additions and 53 deletions

View File

@@ -1,26 +1,39 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0)
project(looking-glass-client C)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
SET(CMAKE_C_FLAGS "-std=gnu99 -g -O3 -march=native -Wall -Werror -Wfatal-errors -ffast-math -fdata-sections -ffunction-sections")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections")
include(GNUInstallDirs)
include(CheckCCompilerFlag)
option(OPTIMIZE_FOR_NATIVE "Build with -march=native" ON)
if(OPTIMIZE_FOR_NATIVE)
CHECK_C_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
if(COMPILER_SUPPORTS_MARCH_NATIVE)
add_compile_options("-march=native")
endif()
endif()
add_compile_options(
"-Wall"
"-Werror"
"-Wfatal-errors"
"-ffast-math"
"-fdata-sections"
"-ffunction-sections"
"$<$<CONFIG:DEBUG>:-O0;-g3;-ggdb>"
)
set(CMAKE_EXE_LINKER FLAGS "-Wl,--gc-sections")
set(CMAKE_C_STANDARD 11)
find_package(PkgConfig)
pkg_check_modules(PKGCONFIG REQUIRED
sdl2
SDL2_ttf
gl
glu
egl
spice-protocol
fontconfig
x11
xfixes
wayland-egl
libconfig
nettle
hogweed
)
execute_process(
@@ -33,12 +46,11 @@ execute_process(
find_package(GMP)
add_definitions(-D BUILD_VERSION='"${BUILD_VERSION}"')
add_definitions(-D USE_NETTLE)
add_definitions(-D ATOMIC_LOCKING)
add_definitions(-D GL_GLEXT_PROTOTYPES)
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/../common
${PKGCONFIG_INCLUDE_DIRS}
${GMP_INCLUDE_DIR}
@@ -51,29 +63,23 @@ link_libraries(
)
set(SOURCES
main.c
lg-renderer.c
lg-fonts.c
ll.c
utils.c
spice/rsa.c
spice/spice.c
src/main.c
src/lg-renderer.c
src/lg-fonts.c
src/ll.c
src/utils.c
clipboard/x11.c
decoders/null.c
decoders/yuv420.c
renderers/opengl.c
renderers/egl.c
renderers/egl/shader.c
renderers/egl/texture.c
renderers/egl/model.c
renderers/egl/desktop.c
renderers/egl/cursor.c
renderers/egl/fps.c
renderers/egl/draw.c
renderers/egl/splash.c
renderers/egl/alert.c
fonts/sdl.c
)
add_subdirectory(spice)
add_subdirectory(renderers)
add_executable(looking-glass-client ${SOURCES})
target_compile_options(looking-glass-client PUBLIC ${PKGCONFIG_CFLAGS_OTHER})
target_link_libraries(looking-glass-client
spice
renderers
)