Skip to content

Commit

Permalink
Merge pull request #32 from isuruf/install
Browse files Browse the repository at this point in the history
Fix nmake install
  • Loading branch information
isuruf authored Oct 29, 2017
2 parents 1bb023e + 5cf6821 commit 23236a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,25 @@ include_directories(BEFORE
${CMAKE_CURRENT_SOURCE_DIR}/include
)

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

# Install Fortran module files
# TODO: this creates empty directories. Figure out a workaround or
# better would be to figure out why CMAKE_Fortran_MODULE_DIRECTORY is different
install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/
DESTINATION include FILES_MATCHING PATTERN *.mod
)
else()
# Direct module files to build include directory
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include)

# Install Fortran module files
install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/
DESTINATION include
)
endif()

# Install Fortran OpenMP include file
# Copy omp_lib.h file, not the symlink
Expand Down
4 changes: 2 additions & 2 deletions runtime/flang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,8 @@ if (NOT MSVC)
target_compile_options(flang_static PRIVATE -fPIC)
target_compile_options(flang_shared PRIVATE -fPIC)
else()
target_link_libraries(flang_shared PRIVATE Ws2_32.lib)
target_link_libraries(flang_static PRIVATE Ws2_32.lib)
target_link_libraries(flang_shared Ws2_32.lib)
target_link_libraries(flang_static Ws2_32.lib)

set_target_properties(flang_static PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(flang_shared PROPERTIES LINKER_LANGUAGE CXX)
Expand Down

0 comments on commit 23236a6

Please sign in to comment.