diff options
author | Tony Theodore <tonyt@logyst.com> | 2016-07-16 06:06:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-16 06:06:44 (GMT) |
commit | 33f6ecea7b7ceb74051e9f0387c253834b71598f (patch) | |
tree | 6bea46277c2ec7e3a94518cdde78f7261b48d0b5 /src | |
parent | 76eef2bc5f4218c92189b95c9f2f4741eab79aa2 (diff) | |
parent | e0d07d5e8b020ed02e19b2838fc99b42f00af729 (diff) | |
download | mxe-33f6ecea7b7ceb74051e9f0387c253834b71598f.zip mxe-33f6ecea7b7ceb74051e9f0387c253834b71598f.tar.gz mxe-33f6ecea7b7ceb74051e9f0387c253834b71598f.tar.bz2 |
Merge pull request #1440 from LuaAndC/yaml-cpp
add yaml-cpp (second attempt)
Diffstat (limited to 'src')
-rw-r--r-- | src/yaml-cpp-1-fixes.patch | 29 | ||||
-rw-r--r-- | src/yaml-cpp-test.cpp | 8 | ||||
-rw-r--r-- | src/yaml-cpp.mk | 29 |
3 files changed, 66 insertions, 0 deletions
diff --git a/src/yaml-cpp-1-fixes.patch b/src/yaml-cpp-1-fixes.patch new file mode 100644 index 0000000..73102ea --- /dev/null +++ b/src/yaml-cpp-1-fixes.patch @@ -0,0 +1,29 @@ +This file is part of MXE. +See index.html for further information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Boris Nagaev <bnagaev@gmail.com> +Date: Sat, 16 Jul 2016 00:24:39 +0200 +Subject: [PATCH] generate .pc file on MinGW + +Install to lib/pkgconfig, not to bin/pkgconfig. + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1111111..2222222 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -317,10 +317,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config.cmake.in + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config-version.cmake.in + "${PROJECT_BINARY_DIR}/yaml-cpp-config-version.cmake" @ONLY) + +-if(UNIX) ++if(UNIX OR MINGW) + set(PC_FILE ${CMAKE_BINARY_DIR}/yaml-cpp.pc) + configure_file("yaml-cpp.pc.cmake" ${PC_FILE} @ONLY) +- install(FILES ${PC_FILE} DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) ++ install(FILES ${PC_FILE} DESTINATION lib/pkgconfig) + endif() + + diff --git a/src/yaml-cpp-test.cpp b/src/yaml-cpp-test.cpp new file mode 100644 index 0000000..2b91ba4 --- /dev/null +++ b/src/yaml-cpp-test.cpp @@ -0,0 +1,8 @@ +#include <assert.h> +#include <yaml-cpp/yaml.h> + +int main() { + YAML::Node node = YAML::Load("[1, 2, 3]"); + assert(node.IsSequence()); + return 0; +} diff --git a/src/yaml-cpp.mk b/src/yaml-cpp.mk new file mode 100644 index 0000000..40adc0f --- /dev/null +++ b/src/yaml-cpp.mk @@ -0,0 +1,29 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := yaml-cpp +$(PKG)_IGNORE := +$(PKG)_VERSION := 0.5.3 +$(PKG)_CHECKSUM := ac50a27a201d16dc69a881b80ad39a7be66c4d755eda1f76c3a68781b922af8f +$(PKG)_SUBDIR := $(PKG)-release-$($(PKG)_VERSION) +$(PKG)_FILE := yaml-cpp-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := https://github.com/jbeder/yaml-cpp/archive/release-$($(PKG)_VERSION).tar.gz +$(PKG)_DEPS := gcc boost + +define $(PKG)_UPDATE + $(call MXE_GET_GITHUB_TAGS, jbeder/yaml-cpp, \(yaml-cpp-\|release-\)) +endef + +define $(PKG)_BUILD + cd '$(BUILD_DIR)' && $(TARGET)-cmake \ + -DBUILD_SHARED_LIBS=$(CMAKE_SHARED_BOOL) \ + '$(SOURCE_DIR)' + + $(MAKE) -C '$(BUILD_DIR)' -j $(JOBS) VERBOSE=1 + $(MAKE) -C '$(BUILD_DIR)' -j 1 install + + '$(TARGET)-g++' \ + -W -Wall -Werror -ansi -pedantic \ + '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \ + `'$(TARGET)-pkg-config' $(PKG) --cflags --libs` +endef |