Skip to content

Commit

Permalink
better handling of shared library builds
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Feb 28, 2023
1 parent 542e838 commit c36bd62
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@ project(w3emc VERSION ${pVersion} LANGUAGES C Fortran)

# Handle user options.
option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(BUILD_4 "Build the 4-byte real version of the library, libw3emc_4.a" ON)
option(BUILD_D "Build the 8-byte real version of the library, libw3emc_d.a" ON)
option(BUILD_TESTING "Build tests of the library" ON)
option(BUILD_WITH_EXTRA_DEPS "Build w3emc with subprograms which call unknown dependencies" ON)
option(BUILD_WITH_BUFR "Build w3emc with subprograms which call NCEPLIBS-bufr" ON)

# If building shared, extra dependencies must be eliminated.
if(BUILD_SHARED_LIBS)
if(BUILD_WITH_EXTRA_DEPS)
message(FATAL_ERROR "Shared libraries cannot be built without setting -DBUILD_WITH_EXTRA_DEPS=OFF.")
endif()
endif()

# Figure whether user wants a _4, a _d, or both libraries.
if(BUILD_4 AND BUILD_D)
set(kinds "4" "d")
Expand Down

0 comments on commit c36bd62

Please sign in to comment.