CMakeLists.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. add_library(MathFunctions)
  2. target_sources(MathFunctions
  3. PRIVATE
  4. MathFunctions.cxx
  5. PUBLIC
  6. FILE_SET HEADERS
  7. FILES
  8. MathFunctions.h
  9. )
  10. # TODO8: Add the interface library to MathFunctions
  11. target_link_libraries(MathFunctions
  12. PRIVATE
  13. MathLogger
  14. PUBLIC
  15. OpAdd
  16. OpMul
  17. OpSub
  18. )
  19. target_compile_features(MathFunctions PRIVATE cxx_std_20)
  20. if(TUTORIAL_USE_STD_SQRT)
  21. target_compile_definitions(MathFunctions PRIVATE TUTORIAL_USE_STD_SQRT)
  22. endif()
  23. include(CheckIncludeFiles)
  24. check_include_files(emmintrin.h HAS_EMMINTRIN LANGUAGE CXX)
  25. if(HAS_EMMINTRIN)
  26. target_compile_definitions(MathFunctions PRIVATE TUTORIAL_USE_SSE2)
  27. endif()
  28. include(CheckSourceCompiles)
  29. check_source_compiles(CXX
  30. [=[
  31. typedef double v2df __attribute__((vector_size(16)));
  32. int main() {
  33. __builtin_ia32_sqrtsd(v2df{});
  34. }
  35. ]=]
  36. HAS_GNU_BUILTIN
  37. )
  38. if(HAS_GNU_BUILTIN)
  39. target_compile_definitions(MathFunctions PRIVATE TUTORIAL_USE_GNU_BUILTIN)
  40. endif()
  41. add_subdirectory(MathLogger)
  42. add_subdirectory(MathExtensions)
  43. # TODO9: Add the MakeTable subdirectory to the project