CMakeLists.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. target_link_libraries(MathFunctions
  11. PRIVATE
  12. MathLogger
  13. PUBLIC
  14. OpAdd
  15. OpMul
  16. OpSub
  17. )
  18. target_compile_features(MathFunctions PRIVATE cxx_std_20)
  19. if(TUTORIAL_USE_STD_SQRT)
  20. target_compile_definitions(MathFunctions PRIVATE TUTORIAL_USE_STD_SQRT)
  21. endif()
  22. # TODO1: Include the CheckIncludeFiles module and use it to check for
  23. # the emmintrin.h header.
  24. # TODO2: If emmintrin.h is available, add a compile definition to MathFunctions
  25. # named TUTORIAL_USE_SSE2. This will only be needed by the MathFunctions
  26. # implementation file.
  27. # TODO4: Include the CheckSourceCompiles module and use it to check if the
  28. # following program compiles:
  29. #
  30. # typedef double v2df __attribute__((vector_size(16)));
  31. # int main() {
  32. # __builtin_ia32_sqrtsd(v2df{});
  33. # }
  34. # TODO5: If the GNU builtins are available, add a compile definition to
  35. # MathFunctions named TUTORIAL_USE_GNU_BUILTIN. This will only be needed
  36. # by the MathFunctions implementation file.
  37. add_subdirectory(MathLogger)
  38. add_subdirectory(MathExtensions)