freebsd-ports/devel/flang/files/patch-CMakeLists.txt
Johannes M Dieterich 589d6627b2 new ports: devel/flang and devel/flang-clang.
Welcome the freshly released flang Fortran LLVM compiler (currently only for amd6) ! It needs as a companion a custom clang, added as flang-clang.

Reviewed by:	swills (mentor)
Approved by:	swills (mentor)
Differential Revision:	https://reviews.freebsd.org/D10805
2017-05-19 02:01:51 +00:00

50 lines
1.9 KiB
Text

--- CMakeLists.txt.orig 2017-05-17 00:40:01 UTC
+++ CMakeLists.txt
@@ -23,7 +23,7 @@ cmake_minimum_required(VERSION 2.8)
SET(CMAKE_Fortran_COMPILER_WORKS 1)
if( NOT DEFINED TARGET_ARCHITECTURE )
- execute_process(COMMAND uname -i OUTPUT_STRIP_TRAILING_WHITESPACE
+ execute_process(COMMAND uname -m OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE TARGET_ARCHITECTURE)
execute_process(COMMAND uname -s OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE TARGET_OS)
@@ -48,6 +48,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()
@@ -56,7 +69,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:
@@ -292,7 +306,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")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-macro-redefined -Wno-logical-not-parentheses -Wno-unknown-warning-option")
endif ()
if (APPLE)