CMakeLists.txt 1.1 KB

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