1
0
Эх сурвалжийг харах

Tutorial: Fix-up typos and inconsistencies

* Fix typo in Step 2
* Fix incorrect code referenced in Step 3, TODO 7. Update comments in
MathFunctions/CMakeLists.txt to unique strings.
* Resolve inconsistencies between steps in MathFunctions/CMakeLists.txt
betsy.mcphail 2 жил өмнө
parent
commit
a94a4c12e1

+ 5 - 7
Help/guide/tutorial/Adding Usage Requirements for a Library.rst

@@ -245,10 +245,9 @@ then use :command:`target_compile_features` to add the compiler feature
   </details>
 
 Finally, with our interface library set up, we need to link our
-executable ``Target``, our ``MathFunctions`` library, and our ``SqrtLibrary``
-library to our new
-``tutorial_compiler_flags`` library. Respectively, the code will look like
-this:
+executable ``Tutorial``, our ``SqrtLibrary`` library and our ``MathFunctions``
+library to our new ``tutorial_compiler_flags`` library. Respectively, the code
+will look like this:
 
 .. raw:: html
 
@@ -275,7 +274,7 @@ this:
   :caption: TODO 6: MathFunctions/CMakeLists.txt
   :name: MathFunctions-CMakeLists.txt-target_link_libraries-step4
   :language: cmake
-  :start-after: # link our compiler flags interface library
+  :start-after: # link SqrtLibrary to tutorial_compiler_flags
   :end-before: target_link_libraries(MathFunctions
 
 .. raw:: html
@@ -292,8 +291,7 @@ and this:
   :caption: TODO 7: MathFunctions/CMakeLists.txt
   :name: MathFunctions-SqrtLibrary-target_link_libraries-step4
   :language: cmake
-  :start-after: # link our compiler flags interface library
-  :end-before: target_link_libraries(MathFunctions PUBLIC SqrtLibrary)
+  :start-after: # link MathFunctions to tutorial_compiler_flags
 
 .. raw:: html
 

+ 1 - 1
Help/guide/tutorial/Adding a Library.rst

@@ -184,7 +184,7 @@ Now let's use our library. In ``tutorial.cxx``, include ``MathFunctions.h``:
 
   </details>
 
-Lastly, replace ``sqrt`` with our library function ``mathfunctions::mysqrt``.
+Lastly, replace ``sqrt`` with the wrapper function ``mathfunctions::sqrt``.
 
 .. raw:: html
 

+ 3 - 0
Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt

@@ -33,10 +33,13 @@ if(USE_MYMATH)
                         POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
                         )
 
+  # link SqrtLibrary to tutorial_compiler_flags
   target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags)
+
   target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
 endif()
 
+# link MathFunctions to tutorial_compiler_flags
 target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
 
 # define the symbol stating we are using the declspec(dllexport) when

+ 3 - 0
Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt

@@ -26,10 +26,13 @@ if(USE_MYMATH)
                              ${CMAKE_CURRENT_BINARY_DIR}
                              )
 
+  # link SqrtLibrary to tutorial_compiler_flags
   target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags)
+
   target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
 endif()
 
+# link MathFunctions to tutorial_compiler_flags
 target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
 
 # install libs

+ 3 - 0
Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt

@@ -31,10 +31,13 @@ if(USE_MYMATH)
                         POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
                         )
 
+  # link SqrtLibrary to tutorial_compiler_flags
   target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags)
+
   target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
 endif()
 
+# link MathFunctions to tutorial_compiler_flags
 target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
 
 # define the symbol stating we are using the declspec(dllexport) when

+ 3 - 0
Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt

@@ -33,10 +33,13 @@ if(USE_MYMATH)
                         POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
                         )
 
+  # link SqrtLibrary to tutorial_compiler_flags
   target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags)
+
   target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
 endif()
 
+# link MathFunctions to tutorial_compiler_flags
 target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
 
 # define the symbol stating we are using the declspec(dllexport) when

+ 1 - 1
Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt

@@ -16,7 +16,7 @@ if (USE_MYMATH)
 
   # TODO 7: Link SqrtLibrary to tutorial_compiler_flags
 
-  target_link_libraries(MathFunctions PUBLIC SqrtLibrary)
+  target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
 endif()
 
 # TODO 6: Link MathFunctions to tutorial_compiler_flags

+ 4 - 3
Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt

@@ -17,10 +17,11 @@ if (USE_MYMATH)
               mysqrt.cxx
               )
 
-  # link our compiler flags interface library
+  # link SqrtLibrary to tutorial_compiler_flags
   target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags)
-  target_link_libraries(MathFunctions PUBLIC SqrtLibrary)
+
+  target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
 endif()
 
-# link our compiler flags interface library
+# link MathFunctions to tutorial_compiler_flags
 target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)

+ 3 - 2
Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt

@@ -16,12 +16,13 @@ if (USE_MYMATH)
               mysqrt.cxx
               )
 
-  # link our compiler flags interface library
+  # link SqrtLibrary to tutorial_compiler_flags
   target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags)
+
   target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
 endif()
 
-# link our compiler flags interface library
+# link MathFunctions to tutorial_compiler_flags
 target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
 
 # TODO 1: Create a variable called installable_libs that is a list of all

+ 3 - 1
Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt

@@ -16,11 +16,13 @@ if (USE_MYMATH)
               mysqrt.cxx
               )
 
+  # link SqrtLibrary to tutorial_compiler_flags
   target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags)
+
   target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
 endif()
 
-# link our compiler flags interface library
+# link MathFunctions to tutorial_compiler_flags
 target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
 
 # install libs

+ 2 - 1
Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt

@@ -16,6 +16,7 @@ if (USE_MYMATH)
               mysqrt.cxx
               )
 
+  # link SqrtLibrary to tutorial_compiler_flags
   target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags)
 
   # TODO 1: Include CheckCXXSourceCompiles
@@ -41,7 +42,7 @@ if (USE_MYMATH)
   target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
 endif()
 
-# link our compiler flags interface library
+# link MathFunctions to tutorial_compiler_flags
 target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
 
 # install libs

+ 2 - 1
Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt

@@ -10,6 +10,7 @@ if (USE_MYMATH)
               mysqrt.cxx
               )
 
+  # link SqrtLibrary to tutorial_compiler_flags
   target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags)
 
   # does this system provide the log and exp functions?
@@ -45,7 +46,7 @@ target_include_directories(MathFunctions
                            INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
                            )
 
-# link our compiler flags interface library
+# link MathFunctions to tutorial_compiler_flags
 target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
 
 # install libs

+ 3 - 0
Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt

@@ -25,10 +25,13 @@ if (USE_MYMATH)
                              ${CMAKE_CURRENT_BINARY_DIR}
                              )
 
+  # link SqrtLibrary to tutorial_compiler_flags
   target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags)
+
   target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
 endif()
 
+# link MathFunctions to tutorial_compiler_flags
 target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
 
 # install libs