[libc-commits] [PATCH] D105643: [libc] Specificying compilation flags for Windows

Arthur Eubanks via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jul 8 10:58:52 PDT 2021


aeubanks added inline comments.


================
Comment at: libc/cmake/modules/LLVMLibCObjectRules.cmake:5
+  if(${LIBC_TARGET_OS} STREQUAL "windows") 
+    set(${output_var}${LLVM_CXX_STD_default} /Qfreestanding ${LIBC_COMPILE_OPTIONS_DEFAULT} ${ARGN} PARENT_SCOPE)
+  else()
----------------
missing a space


================
Comment at: libc/cmake/modules/LLVMLibCObjectRules.cmake:7
+  else()
+   set(${output_var} -fpie ${LLVM_CXX_STD_default} -ffreestanding ${LIBC_COMPILE_OPTIONS_DEFAULT} ${ARGN} PARENT_SCOPE)
+  endif()
----------------
I'd recommend setting the common flags outside the if, then adding `-fpie -ffreestanding` / `/Qfreestanding` in the if

I think
```
set(${output_var} ${output_var} -extraflags)
```
should append flags


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105643



More information about the libc-commits mailing list