[Openmp-commits] [PATCH] D16525: Add CMAKE variable to enable creation of static OpenMP libraries instead of dynamic ones

Hal Finkel via Openmp-commits openmp-commits at lists.llvm.org
Wed Feb 3 20:18:48 PST 2016


hfinkel added a subscriber: hfinkel.

================
Comment at: runtime/CMakeLists.txt:280-283
@@ -279,2 +279,6 @@
 
+# Default to shared library
+set(LIBOMP_SHARED_LIBRARY TRUE CACHE BOOL
+  "Create shared library?")
+
 # OMPT-support
----------------
jlpeyton wrote:
> This is a minor nit, but can this be renamed to LIBOMP_STATIC_LIBRARY which is FALSE by default.  Setting a feature to true to enable the feature seems a little more intuitive for the user.  Also, make a note in the comment that this feature isn't available on Windows, and put below this:
> 
> ```
>  if(WIN32 AND LIBOMP_STATIC_LIBRARY)
>    libomp_error_say("Static libraries requested but not available on Windows")
>  endif()
> ```
> This is a minor nit, but can this be renamed to LIBOMP_STATIC_LIBRARY which is FALSE by default. 

FWIW, the libc++ option is named:

  option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)

and the LLVM option is named (strangely without an LLVM_ prefix):

  option(BUILD_SHARED_LIBS
    "Build all libraries as shared libraries instead of static" OFF)

so it might be more consistent to leave the option with the proposed sense. We might even want to mirror libc++ more closely and name it LIBOMP_ENABLE_SHARED.

I don't, however, feel strongly about it either way. I would like to get this in, however; it is something we need.



Repository:
  rL LLVM

http://reviews.llvm.org/D16525





More information about the Openmp-commits mailing list