Commit 64160569 by Maarten L. Hekkelman

disable resources on macOS

parent 4fdfd03c
......@@ -85,6 +85,9 @@ CXXFLAGS += -Wall -Wno-multichar -I include
# Use the DEBUG flag to build debug versions of the code
DEBUG = @DEBUG@
USE_RSRC = @USE_RSRC@
DEFINES += USE_RSRC=$(USE_RSRC)
ifeq "$(DEBUG)" "1"
DEFINES += DEBUG
CXXFLAGS += -g -O0
......@@ -191,7 +194,7 @@ $(OBJDIR)/%.o: %.cpp | $(OBJDIR)
.PHONY: clean
clean:
rm -rf .libs $(OBJDIR)/* $(LIB_TARGET)
rm -f $(TESTS:%=%-test)
rm -f $(TESTS:%=test/%-test)
.PHONY: distclean
distclean: clean
......@@ -209,7 +212,7 @@ $(1)_OBJECTS = $$(OBJDIR)/$(1)-test.o
test/$(1)-test: $(LIB_TARGET) $$($(1)_OBJECTS)
@ echo ">>> building $(1)-test"
$(LIBTOOL) --silent --tag=CXX --mode=link $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $$@ $$($(1)_OBJECTS) -L.libs -lcifpp $(LIBS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $$@ $$($(1)_OBJECTS) -L.libs -lcifpp $(LIBS)
.PHONY: $(1)-test
$(1)-test: test/$(1)-test
......
......@@ -647,6 +647,7 @@ SET_MAKE
PKG_CONFIG
CCP4
UPDATE_REVISION
USE_RSRC
DEBUG
LIBCIF_SEMANTIC_VERSION
LIBCIF_LT_VERSION
......@@ -16102,6 +16103,15 @@ if test "x$enable_revision" != "xyes" ; then :
fi
case $host in #(
*-apple-*) :
USE_RSRC=0 ;; #(
*) :
USE_RSRC=1
;;
esac
UPDATE_REVISION=$UPDATE_REVISION
......
......@@ -83,6 +83,13 @@ AS_IF([test "x$enable_revision" != "xyes" ], [
UPDATE_REVISION=1
])
dnl disable resources on macOS
AS_CASE([$host],
[*-apple-*], [USE_RSRC=0],
[USE_RSRC=1]
)
AC_SUBST([USE_RSRC])
AC_SUBST([UPDATE_REVISION], [$UPDATE_REVISION])
AC_ARG_VAR([CCP4], [The location where CCP4 is installed])
......
......@@ -749,6 +749,8 @@ void Progress::message(const std::string& inMessage)
}
#if USE_RSRC
// --------------------------------------------------------------------
//
// Try to find a named resource. Can be either a local file with this name,
......@@ -1155,6 +1157,8 @@ namespace mrsrc
using istream = basic_istream<char, std::char_traits<char>>;
}
#endif
// --------------------------------------------------------------------
namespace cif
......@@ -1177,12 +1181,14 @@ std::unique_ptr<std::istream> loadResource(std::filesystem::path name)
result.reset(file.release());
}
#if USE_RSRC
if (not result)
{
mrsrc::rsrc rsrc(name);
if (rsrc)
result.reset(new mrsrc::istream(rsrc));
}
#endif
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment