================ @@ -38,42 +38,124 @@ function (add_flangrt_library name) ${ARGN}) if (ARG_INSTALL_WITH_TOOLCHAIN AND ARG_EXCLUDE_FROM_ALL) - message(SEND_ERROR "add_flangrt_library(${name} ...): + message(SEND_ERROR "add_flangrt_library(${name} ...): INSTALL_WITH_TOOLCHAIN and EXCLUDE_FROM_ALL are in conflict. When installing an artifact it must have been built first in the 'all' target. - ") + ") + return () endif () - # Also add header files to IDEs to list as part of the library - set_source_files_properties(${ARG_ADDITIONAL_HEADERS} PROPERTIES HEADER_FILE_ONLY ON) + #if (ARG_CMAKE_CONFIGURABLE AND (ARG_STATIC OR ARG_SHARED)) + # message(SEND_ERROR "add_flangrt_library(${name} ...): + # CMAKE_CONFIGURABLE cannot be used together with STATIC or SHARED. + # ") + # return () + #endif () + + #if (NOT ARG_STATIC AND NOT ARG_SHARED AND NOT ARG_CMAKE_CONFIGURABLE AND NOT ARG_OBJECT) + # message(SEND_ERROR "add_flangrt_library(${name} ...): + # Must specifiy library type. + # ") + # return () + #endif () + + set(build_static OFF) + set(build_shared OFF) + if (ARG_STATIC AND FLANG_RT_ENABLE_STATIC) + set(build_static ON) + endif () + if (ARG_SHARED AND FLANG_RT_ENABLE_SHARED) ---------------- jeanPerier wrote:
I am not seeing the shared library version of libflang_rt being built with this patch. It seems `build_shared` is always set to OFF because `ARG_SHARED` is not set for flang_rt, https://github.com/llvm/llvm-project/pull/120213 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits