Get the trace player to work with Windows
[platform/upstream/Vulkan-Tools.git] / CMakeLists.txt
1 # The name of our project is "XGL". CMakeLists files in this project can
2 # refer to the root source directory of the project as ${XGL_SOURCE_DIR} and
3 # to the root binary directory of the project as ${XGL_BINARY_DIR}.
4 cmake_minimum_required(VERSION 2.8.11)
5 project (XGL)
6 # set (CMAKE_VERBOSE_MAKEFILE 1)
7
8 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
9
10 # Header file for CMake settings
11 include_directories("${PROJECT_SOURCE_DIR}/include")
12
13 include(FindPkgConfig)
14
15 if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
16     set(COMMON_COMPILE_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
17     set(COMMON_COMPILE_FLAGS "${COMMON_COMPILE_FLAGS} -fno-strict-aliasing -fno-builtin-memcmp")
18     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ${COMMON_COMPILE_FLAGS}")
19     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILE_FLAGS}")
20     if (UNIX)
21         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
22         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
23     endif()
24 endif()
25
26 if (NOT WIN32)
27     # Hard code our LunarGLASS and glslang paths for now
28     get_filename_component(GLSLANG_PREFIX ../glslang ABSOLUTE)
29     get_filename_component(LUNARGLASS_PREFIX ../LunarGLASS ABSOLUTE)
30
31     if(NOT EXISTS ${GLSLANG_PREFIX})
32         message(FATAL_ERROR "Necessary glslang components do not exist: " ${GLSLANG_PREFIX})
33     endif()
34
35     if(NOT EXISTS ${LUNARGLASS_PREFIX})
36         message(FATAL_ERROR "Necessary LunarGLASS components do not exist: " ${GLSLANG_PREFIX})
37     endif()
38 endif()
39
40 # loader: Generic XGL ICD loader
41 # icd: Device dependent (DD) XGL components
42 # tests: XGL tests
43 add_subdirectory(loader)
44 add_subdirectory(icd)
45 if (NOT WIN32)
46     add_subdirectory(tests)
47 endif()
48 add_subdirectory(layers)
49 add_subdirectory(libs)
50 add_subdirectory(demos)
51 add_subdirectory(tools/glave)