1cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
2
3project(libs LANGUAGES C)
4
5if(ENABLE_64)
6  message(STATUS "Building for 64bit")
7else()
8  add_compile_options(-m32)
9  add_link_options(-m32)
10  message(STATUS "Building for 32bit")
11endif()
12message(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}.")
13
14add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../threadx threadx)
15target_compile_options(threadx PRIVATE -DTX_ENABLE_EVENT_TRACE -DTX_LINUX_NO_IDLE_ENABLE)
16
17get_target_property(dirs threadx INCLUDE_DIRECTORIES)
18execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/inc)
19foreach(dir ${dirs})
20  file(GLOB header_files ${dir}/*.h)
21  foreach(header_file ${header_files})
22    execute_process(COMMAND ln -sf ${header_file} ${CMAKE_BINARY_DIR}/inc)
23  endforeach()
24endforeach()
25