Skip to content

Commit

Permalink
Release preparation (#288)
Browse files Browse the repository at this point in the history
* Improve debug output

* Release preparation
  • Loading branch information
eile authored Dec 2, 2016
1 parent b86aeb3 commit e1ecab8
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .gitexternals
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- mode: cmake -*-
# CMake/common https://github.com/Eyescale/CMake.git 11ee9c1
# CMake/common https://github.com/Eyescale/CMake.git 4f20da0
2 changes: 1 addition & 1 deletion .gitsubprojects
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- mode: cmake -*-
git_subproject(Servus https://github.com/HBPVIS/Servus.git 9fb8f08)
git_subproject(Servus https://github.com/HBPVIS/Servus.git 895ab49)
59 changes: 11 additions & 48 deletions CMake/GitExternal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# update target to bump the tag to the master revision by
# recreating .gitexternals.
# * Provides function
# git_external(<directory> <giturl> <gittag> [VERBOSE,SHALLOW]
# git_external(<directory> <giturl> <gittag> [VERBOSE]
# [RESET <files>])
# which will check out directory in CMAKE_SOURCE_DIR (if relative)
# or in the given absolute path using the given repository and tag
Expand All @@ -18,11 +18,6 @@
# VERBOSE, when present, this option tells the function to output
# information about what operations are being performed by git on
# the repo.
# SHALLOW, when present, causes a shallow clone of depth 1 to be made
# of the specified repo. This may save considerable memory/bandwidth
# when only a specific branch of a repo is required and the full history
# is not required. Note that the SHALLOW option will only work for a branch
# or tag and cannot be used for an arbitrary SHA.
# OPTIONAL, when present, this option makes this operation optional.
# The function will output a warning and return if the repo could not be
# cloned.
Expand Down Expand Up @@ -69,15 +64,8 @@ macro(GIT_EXTERNAL_MESSAGE msg)
endif()
endmacro()

# utility function for printing a list with custom separator
function(JOIN VALUES GLUE OUTPUT)
string (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}")
string (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
endfunction()

function(GIT_EXTERNAL DIR REPO tag)
cmake_parse_arguments(GIT_EXTERNAL_LOCAL "VERBOSE;SHALLOW;OPTIONAL" "" "RESET" ${ARGN})
cmake_parse_arguments(GIT_EXTERNAL_LOCAL "VERBOSE;OPTIONAL" "" "RESET" ${ARGN})
set(TAG ${tag})
if(GIT_EXTERNAL_TAG AND "${tag}" MATCHES "^[0-9a-f]+$")
set(TAG ${GIT_EXTERNAL_TAG})
Expand Down Expand Up @@ -105,16 +93,9 @@ function(GIT_EXTERNAL DIR REPO tag)

if(NOT EXISTS "${DIR}")
# clone
set(_clone_options --recursive)
if(GIT_EXTERNAL_LOCAL_SHALLOW)
list(APPEND _clone_options --depth 1 --branch ${TAG})
else()
set(_msg_tag "[${TAG}]")
endif()
JOIN("${_clone_options}" " " _msg_text)
message(STATUS "git clone ${_msg_text} ${REPO} ${DIR} ${_msg_tag}")
message(STATUS "git clone --recursive ${REPO} ${DIR} [${TAG}]")
execute_process(
COMMAND "${GIT_EXECUTABLE}" clone ${_clone_options} ${REPO} ${DIR}
COMMAND "${GIT_EXECUTABLE}" clone --recursive ${REPO} ${DIR}
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${GIT_EXTERNAL_DIR}")
if(nok)
Expand All @@ -127,21 +108,8 @@ function(GIT_EXTERNAL DIR REPO tag)
endif()

# checkout requested tag
if(NOT GIT_EXTERNAL_LOCAL_SHALLOW)
execute_process(
COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}"
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${DIR}")
if(nok)
message(FATAL_ERROR "git checkout ${TAG} in ${DIR} failed: ${error}\n")
endif()
endif()

# checkout requested tag
execute_process(
COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}"
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${DIR}")
execute_process(COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}"
RESULT_VARIABLE nok ERROR_VARIABLE error WORKING_DIRECTORY "${DIR}")
if(nok)
message(FATAL_ERROR "git checkout ${TAG} in ${DIR} failed: ${error}\n")
endif()
Expand Down Expand Up @@ -281,13 +249,10 @@ if(EXISTS ${GIT_EXTERNALS} AND NOT GIT_EXTERNAL_SCRIPT_MODE)
if(NOT TARGET update)
add_custom_target(update)
endif()
if(NOT TARGET update-gitexternal)
add_custom_target(update-gitexternal)
add_custom_target(flatten-gitexternal)
add_dependencies(update update-gitexternal)
endif()
if(NOT TARGET ${PROJECT_NAME}-flatten-gitexternal)
if(NOT TARGET ${PROJECT_NAME}-update-gitexternal)
add_custom_target(${PROJECT_NAME}-update-gitexternal)
add_custom_target(${PROJECT_NAME}-flatten-gitexternal)
add_dependencies(update ${PROJECT_NAME}-update-gitexternal)
endif()

# Create a unique, flat name
Expand Down Expand Up @@ -328,7 +293,7 @@ endif()")
COMMENT "Update ${REPO} in ${GIT_EXTERNALS_BASE}"
DEPENDS ${GIT_EXTERNAL_TARGET}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_dependencies(update-gitexternal
add_dependencies(${PROJECT_NAME}-update-gitexternal
update-gitexternal-${GIT_EXTERNAL_NAME})

# Flattens a git external repository into its parent repo:
Expand All @@ -346,12 +311,10 @@ endif()")
COMMENT "Flatten ${REPO} into ${DIR}"
DEPENDS ${PROJECT_NAME}-make-branch
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${DIR}")
add_dependencies(flatten-gitexternal
flatten-gitexternal-${GIT_EXTERNAL_NAME})
add_dependencies(${PROJECT_NAME}-flatten-gitexternal
flatten-gitexternal-${GIT_EXTERNAL_NAME})

foreach(_target flatten-gitexternal-${GIT_EXTERNAL_NAME} ${PROJECT_NAME}-flatten-gitexternal flatten-gitexternal update-gitexternal-${GIT_EXTERNAL_NAME} ${GIT_EXTERNAL_TARGET} update-gitexternal update)
foreach(_target flatten-gitexternal-${GIT_EXTERNAL_NAME} ${PROJECT_NAME}-flatten-gitexternal update-gitexternal-${GIT_EXTERNAL_NAME} ${GIT_EXTERNAL_TARGET} ${PROJECT_NAME}-update-gitexternal update)
set_target_properties(${_target} PROPERTIES
EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER git)
endforeach()
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Copyright (c) 2012-2016 Stefan Eilemann <[email protected]>

cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(Lunchbox VERSION 1.14.0)
set(Lunchbox_VERSION_ABI 7)
project(Lunchbox VERSION 1.15.0)
set(Lunchbox_VERSION_ABI 8)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake
${CMAKE_SOURCE_DIR}/CMake/common)
Expand Down
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,20 @@ development and deployment of multi-threaded applications:

# Building

Lunchbox is a cross-platform library, designed to run on any modern operating
system, including all Unix variants and the Windows operating system. Lunchbox
uses CMake to create a platform-specific build environment. The following
platforms and build environments are tested:
Lunchbox is a cross-platform library, designed to run on any modern
operating system, including all Unix variants and the Windows operating
system. It requires a C++11 compiler and uses CMake to create a
platform-specific build environment. The following platforms and build
environments are tested:

* Linux: Ubuntu 14.04, RHEL 6.6 (Makefile, Ninja)
* Linux: Ubuntu 16.04, RHEL 6.8 (Makefile, Ninja)
* Windows: 7 (Visual Studio 2012)
* Mac OS X: 10.8 (Makefile, Ninja)
* Mac OS X: 10.9 (Makefile, Ninja)

Building from source is as simple as:

git clone https://github.com/Eyescale/Lunchbox.git
mkdir Lunchbox/build
cd Lunchbox/build
cmake ..
make


cmake -GNinja ..
ninja
4 changes: 4 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

# git master

# Release 1.15 (09-12-2016)

* [283](https://github.com/Eyescale/Lunchbox/pull/283):
Break PersistentMap out into keyv::Map
* [278](https://github.com/Eyescale/Lunchbox/pull/278):
Simplified Plugin API
* [276](https://github.com/Eyescale/Lunchbox/pull/276):
Renamed UnorderedIntervalSet to IntervalSet
* [275](https://github.com/Eyescale/Lunchbox/pull/275):
Expand Down
2 changes: 1 addition & 1 deletion lunchbox/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace lunchbox

void abort( const bool dumpThreads )
{
LBERROR << " in: " << backtrace << "\n";
LBERROR << " in: " << backtrace << "\n";
if( dumpThreads )
{
LBERROR << "\nThreads:" << std::endl;
Expand Down
16 changes: 8 additions & 8 deletions lunchbox/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ LUNCHBOX_API std::string demangleTypeID( const char* mangled ); //!< @internal
#ifdef _WIN32
# pragma warning( disable: 4100 ) // VS Bug
#endif
/** Print the RTTI name of the given class. @version 1.0 */
template< class T > inline std::string className( const T* object )
{ return demangleTypeID( typeid( *object ).name( )); }

/** Print the RTTI name of the given class. @version 1.0 */
template< class T > inline std::string className( const T& object )
{ return demangleTypeID( typeid( object ).name( )); }

/** Print the RTTI name of the given class. @version 1.0 */
template< class T > inline std::string className( const T* object )
{ return className( *object ); }

#ifdef _WIN32
# pragma warning( default: 4100 )
#endif
Expand Down Expand Up @@ -187,16 +188,15 @@ template< class T > inline std::string format( const std::vector< T >& data )

# define LBUNIMPLEMENTED \
{ LBERROR << "Unimplemented code in " << __FILE__ << ":" << __LINE__ \
<< " "; \
<< " " << lunchbox::className( *this ); \
lunchbox::abort(); }
# define LBUNREACHABLE \
{ LBERROR << "Unreachable code in " << __FILE__ << ":" << __LINE__ \
<< lunchbox::className( this ) \
<< " "; \
<< " " << lunchbox::className( *this ); \
lunchbox::abort(); }
# define LBDONTCALL \
{ LBERROR << "Code is not supposed to be called in this context, type " \
<< lunchbox::className( this ) << " " ; \
<< lunchbox::className( *this ); \
lunchbox::abort(); }

# define LBCHECK(x) { const bool eqOk = x; LBASSERTINFO( eqOk, #x ) }
Expand Down

0 comments on commit e1ecab8

Please sign in to comment.