[libcxx-commits] [libcxx] 448b8e6 - Module documentation improvement: prebuilt module location can be directly fetched via CMake variable. (#78405)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jan 20 12:06:07 PST 2024


Author: LEE KYOUNGHEON
Date: 2024-01-20T21:06:02+01:00
New Revision: 448b8e6162607f42948a11dd50793517198e4445

URL: https://github.com/llvm/llvm-project/commit/448b8e6162607f42948a11dd50793517198e4445
DIFF: https://github.com/llvm/llvm-project/commit/448b8e6162607f42948a11dd50793517198e4445.diff

LOG: Module documentation improvement: prebuilt module location can be directly fetched via CMake variable. (#78405)

CMake officially supports binary directory variable of installed
dependency using `FetchContent`. According to the current documentation,
it fetches `std` module and use its binary directory as hardcoded
string, `${CMAKE_BINARY_DIR}/_deps/std-build`, however it can be
replaced with `${std_BINARY_DIR}`.

Reference: https://cmake.org/cmake/help/latest/module/FetchContent.html

Added: 
    

Modified: 
    libcxx/docs/Modules.rst

Removed: 
    


################################################################################
diff  --git a/libcxx/docs/Modules.rst b/libcxx/docs/Modules.rst
index 5099e6095582cf6..146a91522436d86 100644
--- a/libcxx/docs/Modules.rst
+++ b/libcxx/docs/Modules.rst
@@ -183,8 +183,8 @@ This is a small sample program that uses the module ``std``. It consists of a
   # Adjust project compiler flags
   #
 
-  add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fprebuilt-module-path=${CMAKE_BINARY_DIR}/_deps/std-build/CMakeFiles/std.dir/>)
-  add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fprebuilt-module-path=${CMAKE_BINARY_DIR}/_deps/std-build/CMakeFiles/std.compat.dir/>)
+  add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fprebuilt-module-path=${std_BINARY_DIR}/CMakeFiles/std.dir/>)
+  add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fprebuilt-module-path=${std_BINARY_DIR}/CMakeFiles/std.compat.dir/>)
   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-nostdinc++>)
   # The include path needs to be set to be able to use macros from headers.
   # For example from, the headers <cassert> and <version>.


        


More information about the libcxx-commits mailing list