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")
9 message(FATAL_ERROR "TODO: NaCl support on ${CMAKE_HOST_SYSTEM_NAME}")
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})