[libc-commits] [PATCH] D159112: [libc] POC for namespace customization

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Sep 1 01:55:39 PDT 2023


gchatelet marked 2 inline comments as done.
gchatelet added inline comments.


================
Comment at: libc/CMakeLists.txt:68
+if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
+  add_definitions("-DLIBC_NAMESPACE=${LLVM_LIBC_NAMESPACE}")
+elseif(MSVC)
----------------
sivachandra wrote:
> sivachandra wrote:
> > If we use `add_definitions`, we shouldn't use `-D` or the `/D` syntax. CMake will use the appropriate way to add a macro-def based on the compiler we use.
> I think I am wrong here. Scrub this!
That's actually the case when using `add_compile_definitions` ([doc](https://cmake.org/cmake/help/latest/command/add_compile_definitions.html)) instead of `add_definitions` ([doc](https://cmake.org/cmake/help/latest/command/add_definitions.html)). I've used the more modern version since we can support it (3.20 > 3.12)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159112/new/

https://reviews.llvm.org/D159112



More information about the libc-commits mailing list