summaryrefslogtreecommitdiff
path: root/devel/flang/files/patch-CMakeLists.txt
blob: b5a9de1359005c209146b6e660f989009797b53e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- CMakeLists.txt.orig	2018-09-03 06:03:48 UTC
+++ CMakeLists.txt
@@ -49,6 +49,19 @@ if( ${TARGET_OS} STREQUAL "Linux" )
     message("Unsupported architecture: ${TARGET_ARCHITECTURE}" )
     return()
   endif()
+elseif( ${TARGET_OS} STREQUAL "FreeBSD" )
+  set(OS "FREEBSD")
+  set(OSNAME "FreeBSD")
+  # this is very hacky!
+  if( ${TARGET_ARCHITECTURE} STREQUAL "amd64" )
+    set(ARCHNAME x86-64)
+    set(ARCH X86)
+    set(WRDSZ 64)
+    set(TARGET_ARCHITECTURE x86_64)
+  else()
+    message("Unsupported architecture: ${TARGET_ARCHITECTURE}" )
+    return()
+  endif()
 else()
   message("Unsupported OS: ${TARGET_OS}" )
   return()
@@ -57,7 +70,8 @@ endif()
 # The cmake documentation states that these are set.  They are not so we 
 # set them here
 set(CMAKE_HOST_SYSTEM_NAME ${TARGET_OS})
-set(CMAKE_HOST_SYSTEM_PROCESSOR ${TARGET_ARCHITECTURE})
+# also a hack
+set(CMAKE_HOST_SYSTEM_PROCESSOR "x86-64")
 
 # If we are not building as a part of LLVM, build Flang as an
 # standalone project, using LLVM as an external library:
@@ -289,7 +303,7 @@ endif()
 # Add appropriate flags for GCC
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings")
-  option(WITH_WERROR "Compile with '-Werror' C compiler flag" ON)
+  option(WITH_WERROR "Compile with '-Werror' C compiler flag" OFF)
   if (WITH_WERROR)
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
   endif ()