Skip to content

Commit

Permalink
default to shared on all but win32
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Nov 30, 2018
1 parent 3917f70 commit 31bec23
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ if(NOT realbits)
set(realbits 64)
endif()

# --- other libraries
add_library(maptran SHARED src/maptran.F90 src/vallado.F90)
if(NOT WIN32)
option(BUILD_SHARED_LIBS "Shared libraries .so. Feel free to turn off." ON)
endif()

# --- Maptran library
add_library(maptran src/maptran.F90 src/vallado.F90)
target_compile_options(maptran PRIVATE ${FFLAGS})
target_compile_definitions(maptran PUBLIC REALBITS=${realbits})
# --- testing
Expand Down
4 changes: 2 additions & 2 deletions src/vallado.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module vallado

real(wp), parameter :: pi = 4._wp * atan(1.0_wp)

type,public :: time
type,public :: datetime
integer :: year, month, day, hour, minute
real(wp) :: second
end type
Expand Down Expand Up @@ -133,7 +133,7 @@ elemental real(wp) function toJulian(t) result(jd)
! -----
! JD: Julian Date

type(time), intent(in) :: t
type(datetime), intent(in) :: t
real(wp) :: B, y, m

y = t%year
Expand Down
4 changes: 2 additions & 2 deletions tests/test_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ program Test
deg0 = [15,30,45], &
aaz = [33,43,53]

type(time), parameter :: t0 = time(2014,4,6,8,0,0) ! UTC
type(datetime), parameter :: t0 = datetime(2014,4,6,8,0,0) ! UTC
real(wp), parameter :: jd0 = 2456753.833333_wp


Expand Down Expand Up @@ -190,5 +190,5 @@ program Test
err_msg='angle_sep')


print *,'OK: Maptran'
print *,'OK: Maptran ',storage_size(0._wp),' bits'
end program

0 comments on commit 31bec23

Please sign in to comment.