Permalink
Browse files

CMake updates to support LLVM version for Flang build

  • Loading branch information...
gklimowicz committed Mar 21, 2018
1 parent a692e73 commit 88abd9cfe6549623784dcafbde766c31604ae755
Showing with 10 additions and 16 deletions.
  1. +3 −12 CMakeLists.txt
  2. +4 −3 tools/flang2/flang2exe/ll_structure.h
  3. +3 −1 tools/flang2/include/platform.h.in
@@ -1,5 +1,5 @@
#
# Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2015-2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,8 +14,6 @@
# limitations under the License.
#
#shamelessly stolen from the "other flang" and hacked
cmake_minimum_required(VERSION 2.8)
# In order to bootstrap the runtime library we need to skip
@@ -288,11 +286,6 @@ else()
set(FLANG_HAS_VERSION_PATCHLEVEL 0)
endif()
# Configure the Version.inc file.
#configure_file(
# ${CMAKE_CURRENT_SOURCE_DIR}/include/flang/Basic/Version.inc.in
# ${CMAKE_CURRENT_BINARY_DIR}/include/flang/Basic/Version.inc)
# 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")
@@ -306,10 +299,6 @@ if (APPLE)
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
endif ()
#configure_file(
# ${FLANG_SOURCE_DIR}/include/flang/Config/config.h.cmake
# ${FLANG_BINARY_DIR}/include/flang/Config/config.h)
macro(add_flang_library name)
llvm_process_sources(srcs ${ARGN})
if (MODULE)
@@ -372,6 +361,8 @@ set(LIBFLANG_LIBRARY_VERSION
"Version number that will be placed into the libflang library , in the form XX.YY")
mark_as_advanced(FLANG_EXECUTABLE_VERSION LIBFLANG_LIBRARY_VERSION)
option(FLANG_LLVM_EXTENSIONS "enable the Flang LLVM extensions" OFF)
option(FLANG_INCLUDE_TESTS
"Generate build targets for the Flang unit tests."
${LLVM_INCLUDE_TESTS})
@@ -153,9 +153,10 @@ typedef enum LL_DWARFVersion {
} LL_DWARFVersion;
/* If flang is built with LLVM from github:flang-compiler/llvm, then one can
define the macro FLANG_LLVM_EXTENSIONS to use the Fortran debug information
extensions added to that LLVM. For now, this is disabled. */
#undef FLANG_LLVM_EXTENSIONS
define the cmake macro FLANG_LLVM_EXTENSIONS to use the Fortran debug
information extensions added to that LLVM. For example, use the command:
cmake -DFLANG_LLVM_EXTENSIONS ...
*/
/**
\brief LLVM IR Feature Vector.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,3 +45,5 @@
#define TARGET_@OS@ 1
#define TARGET_@OS@_@ARCH@ 1
#define TARGET_@OS@_@ARCH@@WRDSZ@ 1
#cmakedefine FLANG_LLVM_EXTENSIONS 1

0 comments on commit 88abd9c

Please sign in to comment.