Skip to content

Commit

Permalink
Merge pull request #8 from msarahan/jakirkham-add_yaml
Browse files Browse the repository at this point in the history
build static and dll on win.  Cleanup.
  • Loading branch information
jakirkham committed Apr 28, 2016
2 parents 20da14e + 9295684 commit 692e0fc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 36 deletions.
27 changes: 9 additions & 18 deletions recipes/yaml/CMakeLists.txt.patch
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
diff --git CMakeLists.txt CMakeLists.txt
index e84c28c..eab70b2 100644
index e84c28c..4561133 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -3,6 +3,13 @@
cmake_minimum_required (VERSION 2.8)
project (yaml C)

+# Allow the developer to select if Dynamic or Static libraries are built
+OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
+SET (LIB_TYPE STATIC)
+IF (BUILD_SHARED_LIBS)
+ SET (LIB_TYPE SHARED)
+ENDIF (BUILD_SHARED_LIBS)
+
set (YAML_VERSION_MAJOR 0)
set (YAML_VERSION_MINOR 1)
set (YAML_VERSION_PATCH 6)
@@ -12,5 +19,4 @@ file (GLOB SRC src/*.c)
@@ -11,6 +11,7 @@ set (YAML_VERSION_STRING "${YAML_VERSION_MAJOR}.${YAML_VERSION_MINOR}.${YAML_VER
file (GLOB SRC src/*.c)

include_directories (include win32)
add_definitions (-DHAVE_CONFIG_H -DYAML_DECLARE_STATIC)
-add_definitions (-DHAVE_CONFIG_H -DYAML_DECLARE_STATIC)
-add_library (yaml STATIC ${SRC})
-
+add_library (yaml ${LIB_TYPE} ${SRC})
+add_library (yaml SHARED ${SRC})
+set_target_properties(yaml PROPERTIES COMPILE_FLAGS "-DYAML_DECLARE_EXPORT -DHAVE_CONFIG_H")
+add_library (yaml_static STATIC ${SRC})
+set_target_properties(yaml_static PROPERTIES COMPILE_FLAGS "-DYAML_DECLARE_STATIC -DHAVE_CONFIG_H")
\ No newline at end of file
20 changes: 4 additions & 16 deletions recipes/yaml/bld.bat
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
mkdir build
if errorlevel 1 exit 1

cd build
if errorlevel 1 exit 1


for %%X in (
"on"
"off"
) do (
cmake -G ^
"NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DBUILD_SHARED_LIBS=%%X ^
..
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ..
if errorlevel 1 exit 1

nmake
Expand All @@ -25,7 +11,6 @@ if errorlevel 1 exit 1
::
:: ctest
:: if errorlevel 1 exit 1
)

copy ..\include\yaml.h %LIBRARY_INC%
if errorlevel 1 exit 1
Expand All @@ -35,3 +20,6 @@ if errorlevel 1 exit 1

copy yaml.lib %LIBRARY_LIB%
if errorlevel 1 exit 1

copy yaml_static.lib %LIBRARY_LIB%
if errorlevel 1 exit 1
3 changes: 1 addition & 2 deletions recipes/yaml/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

./configure \
--prefix="${PREFIX}"
./configure --prefix="${PREFIX}"
make
make check
make install
1 change: 1 addition & 0 deletions recipes/yaml/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ test:
- test -f "${PREFIX}/lib/libyaml.a" # [unix]
- test -f "${PREFIX}/lib/libyaml.dylib" # [osx]
- test -f "${PREFIX}/lib/libyaml.so" # [linux]
- if not exist %LIBRARY_LIB%\\yaml_static.lib exit 1 # [win]
- if not exist %LIBRARY_LIB%\\yaml.lib exit 1 # [win]
- if not exist %LIBRARY_BIN%\\yaml.dll exit 1 # [win]

Expand Down

0 comments on commit 692e0fc

Please sign in to comment.