diff options
author | Chris Wilson <chris+github@qwirx.com> | 2015-12-09 22:08:00 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2015-12-09 22:08:00 +0000 |
commit | 333b3e7fc582e967f049504da6e5da6ee862866e (patch) | |
tree | 621d57cce00a4c8d26687b08c7ed6b6df95eef58 | |
parent | f88c58568b67b24bac9551877417b194e2620786 (diff) |
Ask AppVeyor to build Zlib from source using CMake.
Significantly improved CMake config, successfully builds some modules.
-rw-r--r-- | appveyor.yml | 30 | ||||
-rw-r--r-- | infrastructure/cmake/CMakeLists.txt | 35 |
2 files changed, 44 insertions, 21 deletions
diff --git a/appveyor.yml b/appveyor.yml index 4b44e09d..f6c0e3fb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,6 +18,7 @@ configuration: environment: VisualStudioVersion: 10.0 + Generator: Visual Studio 10 cache: - '%APPVEYOR_BUILD_FOLDER%\..\openssl-1.0.2d' @@ -28,17 +29,27 @@ cache: build: parallel: true - project: infrastructure/msvc/2010/boxbackup.sln + project: infrastructure/cmake/BoxBackup.sln install: - cinst strawberryperl - cinst 7zip.commandline + - cinst cmake + - dir "C:\Program Files\Microsoft SDKs\Windows" - dir "C:\Program Files\Microsoft SDKs\Windows\v7.1" - dir "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin" - '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86' - - cd %APPVEYOR_BUILD_FOLDER%\.. - ps: "[Net.ServicePointManager]::SecurityProtocol = 'Tls12'" + + - cd %APPVEYOR_BUILD_FOLDER%\.. + - ps: Start-FileDownload 'http://zlib.net/zlib128.zip' + - 7za x zlib128.zip + - cd zlib-1.2.8 + - cmake -G "%Generator%" -A %PLATFORM% -DCMAKE_INSTALL_PREFIX="..\zlib-%PLATFORM%" . + - msbuild INSTALL.vcxproj /m /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + + - cd %APPVEYOR_BUILD_FOLDER%\.. - ps: Start-FileDownload 'https://www.openssl.org/source/openssl-1.0.2d.tar.gz' - 7za x openssl-1.0.2d.tar.gz - 7za x openssl-1.0.2d.tar @@ -47,18 +58,13 @@ install: - ms\do_ms - nmake /s /f ms\nt.mak - nmake /s /f ms\nt.mak install + - cd %APPVEYOR_BUILD_FOLDER%\.. - - ps: Start-FileDownload 'http://zlib.net/zlib128-dll.zip' - - mkdir %APPVEYOR_BUILD_FOLDER%\..\zlib - - cd %APPVEYOR_BUILD_FOLDER%\..\zlib - - 7za x %APPVEYOR_BUILD_FOLDER%\..\zlib128-dll.zip - - cd %APPVEYOR_BUILD_FOLDER%\.. - - cinst cmake - ps: Start-FileDownload 'ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.zip' - 7za x pcre-8.38.zip - cd %APPVEYOR_BUILD_FOLDER%\.. - cd pcre-8.38 - - cmake . -G "Visual Studio 10" -A %PLATFORM% -DCMAKE_INSTALL_PREFIX="%APPVEYOR_BUILD_FOLDER%\..\pcre-%PLATFORM%" + - cmake -G "%Generator%" -A %PLATFORM% -DCMAKE_INSTALL_PREFIX="..\pcre-%PLATFORM%" . - dir - msbuild INSTALL.vcxproj /m /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - cd %APPVEYOR_BUILD_FOLDER%\.. @@ -66,10 +72,12 @@ install: - dir pcre-%PLATFORM% - dir pcre-%PLATFORM%\bin - dir pcre-%PLATFORM%\lib + - cd %APPVEYOR_BUILD_FOLDER% - dir - - cd infrastructure\msvc - - win32.bat + - cd infrastructure\cmake + - cmake -G "%Generator%" -A %PLATFORM% -DCMAKE_INSTALL_PREFIX="..\pcre-%PLATFORM%" . + - dir - cd %APPVEYOR_BUILD_FOLDER% test_script: diff --git a/infrastructure/cmake/CMakeLists.txt b/infrastructure/cmake/CMakeLists.txt index d5c6d3e7..ccb4b4c8 100644 --- a/infrastructure/cmake/CMakeLists.txt +++ b/infrastructure/cmake/CMakeLists.txt @@ -3,16 +3,6 @@ project(BoxBackup) set(base_dir ${CMAKE_SOURCE_DIR}/../..) -link_libraries(ws2_32 gdi32) - -include_directories(${base_dir}/../openssl-win32/include) -link_directories(${base_dir}/../openssl-win32/lib) -link_libraries(libeay32 ssleay32) - -include_directories(${base_dir}/../pcre-win32/include) -link_directories(${base_dir}/../pcre-win32/lib) -link_libraries(pcreposixd pcred) - set(files_to_configure infrastructure/BoxPlatform.pm contrib/mac_osx/org.boxbackup.bbackupd.plist @@ -184,3 +174,28 @@ endforeach() # PREFIX "../pcre" # BUILD_COMMAND "${CMAKE_EXECUTABLE +# Tell QDBM not to build itself as a DLL, because we want to link statically to it. +target_compile_definitions(qdbm PUBLIC -DQDBM_STATIC) + +# Silence some less-useful warnings +if(MSVC) + add_definitions(/wd4996) + # target_link_libraries(qdbm PRIVATE /IGNORE:LNK4006) + set_property(TARGET qdbm PROPERTY CMAKE_STATIC_LINKER_FLAGS /IGNORE:LNK4006) +endif(MSVC) + +target_link_libraries(lib_common PUBLIC ws2_32 gdi32) + +# Link to OpenSSL +include_directories(${base_dir}/../openssl-win32/include) +find_library(libeay32_lib_path libeay32 ${base_dir}/../openssl-win32/lib) +find_library(ssleay32_lib_path ssleay32 ${base_dir}/../openssl-win32/lib) +target_link_libraries(lib_crypto PUBLIC ${libeay32_lib_path} ${ssleay32_lib_path}) + +# Link to PCRE +include_directories(${base_dir}/../pcre-win32/include) +target_compile_definitions(lib_common PUBLIC -DPCRE_STATIC) +find_library(pcreposixd_lib_path pcreposixd ${base_dir}/../pcre-win32/lib) +find_library(pcred_lib_path pcred ${base_dir}/../pcre-win32/lib) +target_link_libraries(lib_common PUBLIC "${pcreposixd_lib_path}" "${pcred_lib_path}") + |