Skip to content

Commit

Permalink
Merge pull request open-source-parsers#630 from jschueller/appveyor
Browse files Browse the repository at this point in the history
Fix shared/static lib build conflict

resolves open-source-parsers#631
  • Loading branch information
cdunn2001 authored Jul 16, 2017
2 parents cadb6dd + ffdcc93 commit f26edb0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
37 changes: 12 additions & 25 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
# This is a comment.

version: build.{build}

os: Windows Server 2012 R2

clone_folder: c:\projects\jsoncpp

platform:
- Win32
- x64

configuration:
- Debug
- Release

# scripts to run before build
before_build:
- echo "Running cmake..."
- cd c:\projects\jsoncpp
- cmake --version
- set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
- if %PLATFORM% == Win32 cmake .
- if %PLATFORM% == x64 cmake -G "Visual Studio 12 2013 Win64" .

build:
project: jsoncpp.sln # path to Visual Studio solution or project
environment:
matrix:
- CMAKE_GENERATOR: Visual Studio 12 2013
- CMAKE_GENERATOR: Visual Studio 12 2013 Win64
- CMAKE_GENERATOR: Visual Studio 14 2015
- CMAKE_GENERATOR: Visual Studio 14 2015 Win64

build_script:
- cmake --version
- cd c:\projects\jsoncpp
- cmake -G "%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX=%CD:\=/%/install -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON .
- cmake --build . --config Release --target install

deploy:
provider: GitHub
Expand Down
8 changes: 6 additions & 2 deletions src/lib_json/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,12 @@ ENDIF()
IF(BUILD_STATIC_LIBS)
ADD_LIBRARY(jsoncpp_lib_static STATIC ${PUBLIC_HEADERS} ${jsoncpp_sources})
SET_TARGET_PROPERTIES( jsoncpp_lib_static PROPERTIES VERSION ${JSONCPP_VERSION} SOVERSION ${JSONCPP_SOVERSION})
SET_TARGET_PROPERTIES( jsoncpp_lib_static PROPERTIES OUTPUT_NAME jsoncpp
DEBUG_OUTPUT_NAME jsoncpp${DEBUG_LIBNAME_SUFFIX} )
# avoid name clashes on windows as the shared import lib is also named jsoncpp.lib
if (NOT DEFINED STATIC_SUFFIX AND BUILD_SHARED_LIBS)
set (STATIC_SUFFIX "_static")
endif ()
set_target_properties (jsoncpp_lib_static PROPERTIES OUTPUT_NAME jsoncpp${STATIC_SUFFIX}
DEBUG_OUTPUT_NAME jsoncpp${STATIC_SUFFIX}${DEBUG_LIBNAME_SUFFIX})

INSTALL( TARGETS jsoncpp_lib_static ${INSTALL_EXPORT}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand Down

0 comments on commit f26edb0

Please sign in to comment.