gbm: factor out gbm_window_{init,teardown}
[mesa-waffle.git] / cmake / toolchain-nacl-x86_32-glibc.cmake
blobec5779f8079fd0097affa9ff3043e9649d03f57e
2 # NaCl toolchain file for 32bit x86 using glibc C library
5 if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
6     set(CMAKE_SYSTEM_NAME "Linux")
7     set(nacl_host_os "linux")
8 else()
9     message(FATAL_ERROR "TODO: NaCl support on ${CMAKE_HOST_SYSTEM_NAME}")
10 endif()
12 set(nacl_target_arch "i686")
13 set(nacl_ports "glibc_x86_32")
14 set(nacl_toolchain "${nacl_host_os}_x86_glibc")
16 # setup paths for nacl
17 set(nacl_root ${nacl_sdk_path}/${nacl_version})
18 set(nacl_toolpath ${nacl_root}/toolchain/${nacl_toolchain}/bin)
20 # setup compilers from toolchain
21 set(CMAKE_C_COMPILER ${nacl_toolpath}/${nacl_target_arch}-nacl-gcc)
22 set(CMAKE_CXX_COMPILER ${nacl_toolpath}/${nacl_target_arch}-nacl-g++)
24 set(CMAKE_FIND_ROOT_PATH ${nacl_root})
26 # for FIND_LIBRARY|INCLUDE use ${nacl_root} only,
27 # for helper programs during build time, use host
28 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
29 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
30 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
32 # setup nacl includes and required libraries
33 set(nacl_INCLUDE_DIRS ${nacl_INCLUDE_DIRS} ${nacl_sdk_path}/${nacl_version}/include)
34 set(nacl_LIBS ${nacl_sdk_path}/${nacl_version}/lib/${nacl_ports}/${CMAKE_BUILD_TYPE})
35 set(nacl_LDFLAGS
36     -L${nacl_LIBS}
37     -lppapi_cpp
38     -lppapi
39     -lpthread
40     -ldl
41     )