2023-07-02 19:51:09 +02:00
|
|
|
add_library(MathFunctions MathFunctions.cxx)
|
2022-11-16 20:14:03 +01:00
|
|
|
|
|
|
|
# TODO 1: State that anybody linking to MathFunctions needs to include the
|
|
|
|
# current source directory, while MathFunctions itself doesn't.
|
|
|
|
# Hint: Use target_include_directories with the INTERFACE keyword
|
2023-07-02 19:51:09 +02:00
|
|
|
|
|
|
|
# should we use our own math functions
|
|
|
|
option(USE_MYMATH "Use tutorial provided math implementation" ON)
|
|
|
|
if (USE_MYMATH)
|
|
|
|
target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
|
|
|
|
|
|
|
|
# library that just does sqrt
|
|
|
|
add_library(SqrtLibrary STATIC
|
|
|
|
mysqrt.cxx
|
|
|
|
)
|
|
|
|
|
|
|
|
# TODO 7: Link SqrtLibrary to tutorial_compiler_flags
|
|
|
|
|
2023-12-07 09:12:54 +01:00
|
|
|
target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
|
2023-07-02 19:51:09 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# TODO 6: Link MathFunctions to tutorial_compiler_flags
|