Skip to content

Commit

Permalink
Add the CMake build system generator option back for Windows.
Browse files Browse the repository at this point in the history
This option was in the autogen.sh (based on uname instead of proper
detection by configure script, which is now also changed). Add it back
properly in the Makefile rule. Of course it will be used only for
**native** builds on Windows for Windows. Cross-builds for the
librtprocess dependency are still to be done separately.

Also move the rules inside deps/Makefile as it should be, now that we
have a Makefile.am there.
  • Loading branch information
Jehan committed Mar 24, 2020
1 parent db06bcf commit 7589a8a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
11 changes: 0 additions & 11 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ SUBDIRS = deps \
pixmaps \
platform-specific

if !HAVE_LIBRTPROCESS
# not adding it in subdirs because we don't want to run most targets in it, and specifying
# the rtprocess_static target allows us to build only the static lib we link against
build-librtprocess:
mkdir -p $(top_builddir)/deps/librtprocess/build
$(CMAKE) -DCMAKE_BUILD_TYPE="Release" -DWITH_STATIC_LIB=ON -DOPTION_OMP=OFF -S $(top_srcdir)/deps/librtprocess/ -B $(top_builddir)/deps/librtprocess/build
$(MAKE) -C $(top_builddir)/deps/librtprocess/build rtprocess_static

all: build-librtprocess
endif

# TODO add a conditionnal and a configure switch
# to be able to choose the language. Also, this should
# be a recussive make with a separate file list.
Expand Down
21 changes: 21 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,20 @@ if test "x$STD_ATOMIC_NEED_LIBATOMIC" = xyes; then
fi
AC_SUBST([LIBATOMIC_LIBS])

dnl ================ PLATFORM CHECKS ================

AC_MSG_CHECKING([if compiling for Win32])
case "$host_os" in
mingw* | cygwin*)
platform_win32=yes
;;
*)
platform_win32=no
;;
esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")

dnl ================ MANDATORY DEPENDECIES ================
dnl check math lib
AC_CHECK_LIB(m, log, LIBS="$LIBS -lm")
Expand Down Expand Up @@ -162,6 +176,13 @@ if test "x$have_rtprocess" = "xno"; then
if test "x$CMAKE" = xno; then
AC_MSG_ERROR([CMAKE not found (needed to built internal librtprocess)])
fi

CMAKE_GENERATOR=
if test "$platform_win32" = "yes"; then
CMAKE_GENERATOR="-G \"MSYS Makefiles\""
fi
AC_SUBST([CMAKE_GENERATOR])

AC_MSG_NOTICE([librtprocess will be built statically])
else
# When cross-compiling, you should build rtprocess yourself and
Expand Down
11 changes: 11 additions & 0 deletions deps/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,14 @@ all-local:
if [ ! -f "$(top_builddir)/deps/kplot/Makefile" ]; then \
cp -fr "$(top_srcdir)/deps/kplot" "$(top_builddir)/deps/kplot"; \
fi

if !HAVE_LIBRTPROCESS
# not adding it in subdirs because we don't want to run most targets in it, and specifying
# the rtprocess_static target allows us to build only the static lib we link against
build-librtprocess:
mkdir -p $(top_builddir)/deps/librtprocess/build
$(CMAKE) $(CMAKE_GENERATOR) -DCMAKE_BUILD_TYPE="Release" -DWITH_STATIC_LIB=ON -DOPTION_OMP=OFF -S $(top_srcdir)/deps/librtprocess/ -B $(top_builddir)/deps/librtprocess/build
$(MAKE) -C $(top_builddir)/deps/librtprocess/build rtprocess_static

all: build-librtprocess
endif

0 comments on commit 7589a8a

Please sign in to comment.