Skip to content

Commit 47e526e

Browse files
authored
Merge pull request #95 from isuruf/abi
Don't check fortran ABI
2 parents 2486657 + 43164f3 commit 47e526e

File tree

5 files changed

+13
-27
lines changed

5 files changed

+13
-27
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ install:
2020
# Add our channels.
2121
- cmd: conda config --add channels defaults
2222
- cmd: conda config --add channels conda-forge
23-
- cmd: conda install --yes --quiet llvmdev clangdev flang cmake
23+
- cmd: conda install --yes --quiet llvmdev clangdev flang-meta cmake
2424
- cmd: conda install --yes -c isuruf kitware-ninja
2525

2626

.travis.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,9 @@ install:
3030
script:
3131
- mkdir -p build
3232
- cd build
33-
- cmake -DFLANG_INCLUDE_TESTS=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_Fortran_COMPILER=flang ..
33+
- cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DFLANG_INCLUDE_TESTS=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_Fortran_COMPILER=flang ..
3434
- make -j4
35-
36-
- cp lib/* $HOME/miniconda/envs/test-environment/lib
37-
- cp bin/* $HOME/miniconda/envs/test-environment/bin
38-
35+
- make install -j4
3936
- make check-flang
4037

4138
notifications:

CMakeLists.txt

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ cmake_minimum_required(VERSION 2.8)
2121
# In order to bootstrap the runtime library we need to skip
2222
# CMake's Fortran tests
2323
SET(CMAKE_Fortran_COMPILER_WORKS 1)
24-
25-
26-
set(CMAKE_Fortran_PREPROCESS_SOURCE
24+
SET(CMAKE_Fortran_ABI_COMPILED 0)
25+
SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
26+
SET(CMAKE_Fortran_PREPROCESS_SOURCE
2727
"<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")
2828

2929
# If we are not building as a part of LLVM, build Flang as an
@@ -359,25 +359,14 @@ include_directories(BEFORE
359359
${CMAKE_CURRENT_SOURCE_DIR}/include
360360
)
361361

362-
if (MSVC)
363362
# Direct module files to build include directory
364363
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/runtime/flang)
365364

366365
# Install Fortran module files
367-
# TODO: this creates empty directories. Figure out a workaround or
368-
# better would be to figure out why CMAKE_Fortran_MODULE_DIRECTORY is different
369-
install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/
370-
DESTINATION include FILES_MATCHING PATTERN *.mod
371-
)
372-
else()
373-
# Direct module files to build include directory
374-
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include)
375-
376-
# Install Fortran module files
377-
install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/
378-
DESTINATION include
379-
)
380-
endif()
366+
install(
367+
CODE "file(GLOB FLANG_MOD_FILES \"${CMAKE_Fortran_MODULE_DIRECTORY}/*.mod\")"
368+
CODE "file(INSTALL \${FLANG_MOD_FILES} DESTINATION \"${CMAKE_INSTALL_PREFIX}/include\")"
369+
)
381370

382371
# Install Fortran OpenMP include file
383372
# Copy omp_lib.h file, not the symlink

runtime/flang/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,11 @@ SET(FTN_SUPPORT
477477
xfer_rpm1.c
478478
)
479479

480-
add_library(iso_c_bind
480+
add_library(iso_c_bind OBJECT
481481
iso_c_bind.F95
482482
)
483483

484-
add_library(ieee_arithmetic
484+
add_library(ieee_arithmetic OBJECT
485485
ieee_arithmetic.F95
486486
ieee_exceptions.F95
487487
)

runtime/flangrti/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ add_flang_library(flangrti_shared
201201
# Resolve symbols against libm
202202

203203
if (NOT MSVC)
204-
target_link_libraries(flangrti_shared m)
204+
target_link_libraries(flangrti_shared PUBLIC m)
205205
endif()
206206

207207
# Import OpenMP

0 commit comments

Comments
 (0)