diff --git a/CHANGELOG.md b/CHANGELOG.md index ec80782f4ac28d9e9081599f0ccc3639a2bb6a8c..3bdcb8c0730e90929ce25970850b0c801f1f6d09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,5 +23,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed * #11 - Transaction::GetResultSet() now always returns a valid reference. +* #25 - Compiles on MacOS with LLVM now. ### Security diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cdccf80e450d7da1abddba854572189bc583b15..1b7f3e99d817b448769f8710ffe7f4347b869ca5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,6 +63,8 @@ string(REGEX REPLACE "grpc\\+?\\+?_unsecure" "" CONAN_LIBS string(REGEX REPLACE "grpc\\+?\\+?_unsecure" "" CONAN_PKG_LIBS "${CONAN_PKG_LIBS}") +message(STATUS "CONAN_LIBS: ${CONAN_LIBS}") + ########################################### ### GENERAL SETUP of SOURCES ########################################### diff --git a/Makefile b/Makefile index 367c0de989e9fa373b7a01afffc2720a5834508d..819b9ca2910ce5571f1a80412f655f41afa023e5 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ else DETECTED_OS := $(patsubst MINGW%,MSYS,$(DETECTED_OS)) endif ifeq ($(DETECTED_OS),Darwin) # Test if we are on MacOS - CONAN_SETTINGS := "cppstd=11" + CONAN_SETTINGS := "compiler.cppstd=17" endif @@ -53,7 +53,7 @@ style: .PHONY: style conan-install: - conan install . -s $(CONAN_SETTINGS) || \ + conan install . -s $(CONAN_SETTINGS) || \ (echo "'conan install' failed, trying to build from sources..."; \ conan install . -s $(CONAN_SETTINGS) --build=missing) .PHONY: conan-install diff --git a/conanfile.py b/conanfile.py index d29a0a6f091d85426327bd82a4282ca3b9d787de..024be53f48d65d88ed25c93e57ac8ebe9a9f4ce8 100644 --- a/conanfile.py +++ b/conanfile.py @@ -13,7 +13,11 @@ class CaosdbConan(ConanFile): options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} generators = "cmake" - requires = [("boost/1.76.0"), ("gtest/1.11.0"), ("grpc/1.38.0")] + requires = [ + ("boost/1.76.0"), + ("gtest/1.11.0"), + ("grpc/1.38.0"), + ] exports = "*.cpp", "*.h", "*.cmake", "*CMakeLists.txt", "*.in", "*.proto", "*.c" exports_sources = "src", "doc", "include", "test", "cmake", "proto" diff --git a/doc/README_SETUP.md b/doc/README_SETUP.md index 46026eee1da7ea078f93687812833f957bd75312..c0b56bfe627596b4765084d1cf4457acfb7e7545 100644 --- a/doc/README_SETUP.md +++ b/doc/README_SETUP.md @@ -27,7 +27,7 @@ command (3.). Instead of the above conan command (2.) use -2. `conan install .. -s "cppstd=11"` +2. `conan install .. -s "compiler.cppstd=17"` and continue as you would when building on a Linux system. You may have to add `build/lib/` (or, alternatively after installation, @@ -37,7 +37,8 @@ variable. #### Problems and solutions #### - Make sure that your conan version supports your XCode version. A typical symptom of version - mismatch is for example conan complaining about incompatible `compiler.version` settings. + mismatch is for example conan complaining about incompatible `compiler.version` settings. You may + need to rerun any conan and cmake commands (and delete cache files first) after compiler updates. ### How to build on Windows diff --git a/src/caosdb/file_transmission/file_reader.cpp b/src/caosdb/file_transmission/file_reader.cpp index f118eca01c6d17975684a15de56eb7c693fdc117..1a78e5a76513ae0aaf94b2ae4967af5d7b66e0c0 100644 --- a/src/caosdb/file_transmission/file_reader.cpp +++ b/src/caosdb/file_transmission/file_reader.cpp @@ -59,7 +59,7 @@ FileReader::FileReader(boost::filesystem::path filename) } void FileReader::openFile() { - stream_.open(filename_, std::ios::binary | std::ios::ate); + stream_.open(filename_.generic_string(), std::ios::binary | std::ios::ate); if (!stream_) { throw FileIOError("Can't open file for reading: " + filename_.string()); } diff --git a/src/caosdb/file_transmission/file_writer.cpp b/src/caosdb/file_transmission/file_writer.cpp index 5cf7d3a798942fc2ab9a3fe4a278b0e29d362f6e..2c7f2a6000718366f846a4be61dd5c2144370a65 100644 --- a/src/caosdb/file_transmission/file_writer.cpp +++ b/src/caosdb/file_transmission/file_writer.cpp @@ -58,7 +58,7 @@ FileWriter::FileWriter(boost::filesystem::path filename) : filename_(std::move(f } void FileWriter::openFile() { - stream_.open(filename_, std::ios::binary | std::ios::trunc); + stream_.open(filename_.generic_string(), std::ios::binary | std::ios::trunc); if (!stream_) { throw FileIOError("Can't open file for writing: " + filename_.string()); }