Made the build system also build the dependencies

This commit is contained in:
Snaipe 2015-09-04 02:47:06 +02:00
parent ea814f3611
commit 16aae06e79
11 changed files with 61 additions and 59 deletions

View file

@ -0,0 +1,16 @@
git submodule update --init --recursive &&
cd dependencies/dyncall &&
mkdir build && cd build &&
cmake -DCMAKE_INSTALL_PREFIX=%LOCAL_INSTALL% %* .. &&
make &&
make install &&
cd ../../../ &&
cd dependencies/libcsptr/ &&
mkdir build && cd build &&
cmake -DCMAKE_INSTALL_PREFIX=%LOCAL_INSTALL% %* .. &&
make &&
make install

View file

@ -1,4 +1,21 @@
#!/bin/sh
./.ci/install-dyncall.sh
./.ci/install-libcsptr.sh
git submodule update --init --recursive &&
(
cd dependencies/dyncall &&
mkdir build &&
cd $_ &&
cmake -DCMAKE_INSTALL_PREFIX=$LOCAL_INSTALL "$@" .. &&
make &&
make install
) &&
(
cd dependencies/libcsptr/ &&
mkdir build &&
cd $_ &&
cmake -DCMAKE_INSTALL_PREFIX=$LOCAL_INSTALL "$@" .. &&
make &&
make install
)

View file

@ -1,9 +0,0 @@
set repo="https://github.com/Snaipe/dyncall.git"
set tag="master"
mkdir dependencies
git clone --branch %tag% --depth 1 %repo% dependencies/dyncall
cd dependencies/dyncall
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=%LOCAL_INSTALL% -G "NMake Makefiles" ..
nmake

View file

@ -1,14 +0,0 @@
#!/bin/bash
repo="https://github.com/Snaipe/dyncall.git"
tag="master"
mkdir -p dependencies
git clone --branch ${tag} --depth 1 ${repo} dependencies/dyncall &&
(
cd dependencies/dyncall &&
mkdir build &&
cd $_ &&
cmake -DCMAKE_INSTALL_PREFIX=$LOCAL_INSTALL "$@" .. &&
make &&
make install
)

View file

@ -1,14 +0,0 @@
#!/bin/bash
repo="https://github.com/Snaipe/libcsptr.git"
tag="v2.0.4"
mkdir dependencies
git clone --branch ${tag} --depth 1 ${repo} dependencies/libcsptr &&
(
cd dependencies/libcsptr &&
mkdir build &&
cd $_ &&
cmake -DCMAKE_INSTALL_PREFIX=$LOCAL_INSTALL "$@" .. &&
make &&
make install
)

View file

@ -1,4 +0,0 @@
#!/bin/sh
curl -O https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
rm -f get-pip.py

6
.gitmodules vendored Normal file
View file

@ -0,0 +1,6 @@
[submodule "dependencies/libcsptr"]
path = dependencies/libcsptr
url = https://github.com/Snaipe/libcsptr.git
[submodule "dependencies/dyncall"]
path = dependencies/dyncall
url = https://github.com/Snaipe/dyncall.git

View file

@ -2,15 +2,27 @@ cmake_minimum_required(VERSION 2.8)
project(Criterion C)
set(LIBCSPTR_DISABLE_TESTS ON)
add_subdirectory(dependencies/libcsptr/ EXCLUDE_FROM_ALL)
add_subdirectory(dependencies/dyncall/ EXCLUDE_FROM_ALL)
include_directories(
dependencies/libcsptr/include/
dependencies/dyncall/dyncall/
)
# Project setup & environment variables
set(PROJECT_VERSION "1.3.1")
set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
set(GettextTranslate_ALL 1)
set(GettextTranslate_GMO_BINARY 1)
set(MODULE_DIR "${CMAKE_SOURCE_DIR}/.cmake/Modules")
set(MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.cmake/Modules")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${MODULE_DIR})
set_property(GLOBAL PROPERTY ALLOW_DUPLICATE_CUSTOM_TARGETS ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -g -std=gnu99")
if (WIN32)
@ -41,8 +53,6 @@ include(CheckLibraryExists)
CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
find_package(PCRE)
find_package(Libcsptr REQUIRED)
find_package(Dyncall REQUIRED)
# List sources and headers
@ -99,13 +109,13 @@ set(INTERFACE_FILES
# Generate the configure file
configure_file(
"${CMAKE_SOURCE_DIR}/src/config.h.in"
"${CMAKE_SOURCE_DIR}/src/config.h"
"${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in"
"${CMAKE_CURRENT_SOURCE_DIR}/src/config.h"
)
include_directories(include src ${CSPTR_INCLUDE_DIRS})
include_directories(include src)
add_library(criterion SHARED ${SOURCE_FILES} ${INTERFACE_FILES})
target_link_libraries(criterion ${CSPTR_LIBRARIES})
target_link_libraries(criterion csptr dyncall_s)
if (HAVE_CLOCK_GETTIME)
target_link_libraries(criterion rt)
@ -119,10 +129,6 @@ if (LIBINTL_LIB_FOUND)
target_link_libraries(criterion ${LIBINTL_LIBRARIES})
endif()
if (DYNCALL_FOUND)
target_link_libraries(criterion ${DYNCALL_LIBRARIES})
endif()
if (COVERALLS)
coveralls_setup("${SOURCE_FILES}" ${COVERALLS_UPLOAD})
endif()

View file

@ -28,11 +28,7 @@ install:
# Hack to make git think it is on the tip of the repo branch
- 'git checkout -B %APPVEYOR_REPO_BRANCH%'
# Install dependencies
- 'bash -lc "cd $APPVEYOR_BUILD_FOLDER; .ci/install-dyncall.sh -G \"MSYS Makefiles\"; true"'
- 'bash -lc "cd $APPVEYOR_BUILD_FOLDER; .ci/install-libcsptr.sh -G \"MSYS Makefiles\"; true"'
# We need to manually make since the above command somehow crashes
- 'cd dependencies/libcsptr/build && make && make install && cd ../../../'
- 'cd dependencies/dyncall/build && make && make install && cd ../../../'
- '.ci\install-dependencies.bat'
# Configure project
- 'mkdir build && cd build'
- 'cmake -DCMAKE_INSTALL_PREFIX=criterion-%APPVEYOR_REPO_TAG_NAME% -DCMAKE_PREFIX_PATH="%LOCAL_INSTALL%" -DCOVERALLS=ON -DCMAKE_BUILD_TYPE=Debug -G "MSYS Makefiles" ..'

1
dependencies/dyncall vendored Submodule

@ -0,0 +1 @@
Subproject commit 68c57f664d4fabbc5b80327fbf5661a3a5a51e06

1
dependencies/libcsptr vendored Submodule

@ -0,0 +1 @@
Subproject commit a0c2444ccc3c589f34894982cd95032a817c9482