52 lines · plain
1# Infrastructure to build flang driver entry point. Flang driver depends on2# LLVM libraries.3 4# Set your project compile flags.5link_directories(${LLVM_LIBRARY_DIR})6 7set( LLVM_LINK_COMPONENTS8 ${LLVM_TARGETS_TO_BUILD}9 MC10 Option11 Support12 TargetParser13)14 15add_flang_tool(flang16 driver.cpp17 fc1_main.cpp18)19 20target_link_libraries(flang21 PRIVATE22 flangFrontend23 flangFrontendTool24)25 26clang_target_link_libraries(flang27 PRIVATE28 clangDriver29 clangOptions30 clangBasic31)32 33# This creates the executable with a version appended34# and creates a symlink to it without the version35if(CYGWIN OR NOT WIN32) # but it doesn't work on Windows36 set_target_properties(flang PROPERTIES VERSION ${FLANG_EXECUTABLE_VERSION})37endif()38 39option(FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON)40 41# Enable support for plugins, which need access to symbols from flang42if(FLANG_PLUGIN_SUPPORT)43 set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_DIR})44 export_executable_symbols_for_plugins(flang)45endif()46 47install(TARGETS flang DESTINATION "${CMAKE_INSTALL_BINDIR}")48 49# Keep "flang-new" as a symlink for backwards compatiblity. Remove once "flang"50# is a widely adopted name.51add_flang_symlink(flang-new flang)52