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

Caitlyn Cano via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jul 8 13:53:09 PDT 2021


caitlyncano updated this revision to Diff 357348.
caitlyncano added a comment.

[libc] Fixing space and shifting set configuration

Moving outside the common flags outside the if.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105643

Files:
  libc/cmake/modules/LLVMLibCObjectRules.cmake


Index: libc/cmake/modules/LLVMLibCObjectRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -1,7 +1,12 @@
 set(OBJECT_LIBRARY_TARGET_TYPE "OBJECT_LIBRARY")
 
 function(_get_common_compile_options output_var)
-  set(${output_var} -fpie ${LLVM_CXX_STD_default} -ffreestanding ${LIBC_COMPILE_OPTIONS_DEFAULT} ${ARGN} PARENT_SCOPE)
+  set(${output_var} ${LLVM_CXX_STD_default} ${LIBC_COMPILE_OPTIONS_DEFAULT} ${ARGN} PARENT_SCOPE)
+  if(${LIBC_TARGET_OS} STREQUAL "windows")
+    set(${output_var} /Qfreestanding PARENT_SCOPE)
+  else()
+   set(${output_var} -fpie -ffreestanding PARENT_SCOPE)
+  endif()
 endfunction()
 
 # Rule which is essentially a wrapper over add_library to compile a set of


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105643.357348.patch
Type: text/x-patch
Size: 823 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20210708/7dabbf3f/attachment.bin>


More information about the libc-commits mailing list