Skip to content

Commit

Permalink
Changed default .so visibility to hidden, exported desired symbols.
Browse files Browse the repository at this point in the history
  • Loading branch information
KazDragon committed Nov 20, 2015
1 parent 59fe53f commit 3674146
Show file tree
Hide file tree
Showing 75 changed files with 159 additions and 1,418 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project(paradice-9)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")

include(FindBoost)
find_package(Boost
REQUIRED
COMPONENTS
Expand All @@ -22,6 +23,11 @@ find_package(Crypto++)
# CppUnit is required for the unit testing.
find_package(CppUnit)

# When building shared objects, etc., we only want to export certain symbols.
# Therefore, we need to generate headers suitable for declaring which symbols
# should be included.
include(GenerateExportHeader)

if (CPPUNIT_FOUND)
enable_testing()
endif()
Expand Down
1,296 changes: 0 additions & 1,296 deletions cmake/Modules/FindBoost.cmake

This file was deleted.

8 changes: 8 additions & 0 deletions hugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ target_include_directories(hugin
PUBLIC ${Boost_INCLUDE_DIRS}
)

set_target_properties(hugin
PROPERTIES
CXX_VISIBILITY_PRESET hidden
)

target_link_libraries(hugin
INTERFACE munin
)
Expand All @@ -39,3 +44,6 @@ target_compile_features(hugin
cxx_generic_lambdas
)

generate_export_header(hugin
EXPORT_FILE_NAME "${PROJECT_SOURCE_DIR}/hugin/export.hpp"
)
3 changes: 2 additions & 1 deletion hugin/user_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#ifndef HUGIN_USER_INTERFACE_HPP_
#define HUGIN_USER_INTERFACE_HPP_

#include "hugin/export.hpp"
#include "munin/composite_component.hpp"
#include "paradice/active_encounter.hpp"
#include <boost/asio/strand.hpp>
Expand All @@ -50,7 +51,7 @@ BOOST_STATIC_CONSTANT(std::string, FACE_GM_TOOLS = "GM Tools");
/// \brief An abstraction of the primary user interface for the Paradice
/// application.
//* =========================================================================
class user_interface
class HUGIN_EXPORT user_interface
: public munin::composite_component
{
public :
Expand Down
7 changes: 7 additions & 0 deletions munin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ set (munin_SOURCES

add_library(munin ${munin_SOURCES})

set_target_properties(munin
PROPERTIES
CXX_VISIBILITY_PRESET hidden)

target_include_directories(munin
PRIVATE ${CMAKE_SOURCE_DIR}
PUBLIC ${Boost_INCLUDE_DIRS}
Expand All @@ -70,3 +74,6 @@ target_compile_features(munin
cxx_generic_lambdas
)

generate_export_header(munin
EXPORT_FILE_NAME "${PROJECT_SOURCE_DIR}/munin/export.hpp"
)
5 changes: 5 additions & 0 deletions munin/algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class canvas;
//* =========================================================================
/// \brief Returns the intersection of two rectangles.
//* =========================================================================
MUNIN_EXPORT
boost::optional<rectangle> intersection(
rectangle const &lhs
, rectangle const &rhs);
Expand All @@ -51,6 +52,7 @@ boost::optional<rectangle> intersection(
/// area covered by the original rectangles. These are sorted from left to
/// right, top to bottom.
//* =========================================================================
MUNIN_EXPORT
std::vector<rectangle> rectangular_slice(
std::vector<rectangle> const &rectangles);

Expand All @@ -74,6 +76,7 @@ std::vector<rectangle> prune_regions(std::vector<rectangle> regions);
//* =========================================================================
/// \brief Copies a region from one canvas to another.
//* =========================================================================
MUNIN_EXPORT
void copy_region(
rectangle const &region
, canvas const &source
Expand All @@ -82,11 +85,13 @@ void copy_region(
//* =========================================================================
/// \brief Converts a string into an array of elements.
//* =========================================================================
MUNIN_EXPORT
std::vector<element_type> string_to_elements(std::string const &str);

//* =========================================================================
/// \brief Converts an array of strings into an array of arrays of elements.
//* =========================================================================
MUNIN_EXPORT
std::vector< std::vector<element_type> > strings_to_elements(
std::vector<std::string> const &strings);

Expand Down
2 changes: 1 addition & 1 deletion munin/aligned_layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct alignment_data
/// Components added to the aligned will be displayed left-to-right, top-to-
/// bottom.
//* =========================================================================
class aligned_layout : public layout
class MUNIN_EXPORT aligned_layout : public layout
{
protected :
//* =====================================================================
Expand Down
6 changes: 4 additions & 2 deletions munin/ansi/protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ std::vector<std::vector<munin::element_type>>
/// \param source_line a string of text to be converted
/// \param attr the default attribute given to each element.
//* =========================================================================
MUNIN_EXPORT
std::vector<munin::element_type> elements_from_string(
std::string const &source_line
, attribute const &attr = {});

//* =========================================================================
/// \brief Converts a vector<> of ANSI elements into a string.
//* =========================================================================
MUNIN_EXPORT
std::string string_from_elements(
std::vector<munin::element_type> const &elements);

Expand Down Expand Up @@ -86,7 +88,7 @@ std::string set_window_title(std::string const &text);
//* =========================================================================
/// \brief Sets the 'normal cursor keys' mode.
//* =========================================================================
std::string set_normal_cursor_keys();
MUNIN_EXPORT std::string set_normal_cursor_keys();

//* =========================================================================
/// \brief Returns a colour value for a high-colour RGB value.
Expand All @@ -101,7 +103,7 @@ std::string colour_string(munin::attribute::greyscale_colour const &colour);
//* =========================================================================
/// \brief Returns a string that will clear the screen.
//* =========================================================================
std::string clear_screen();
MUNIN_EXPORT std::string clear_screen();

}}

Expand Down
5 changes: 3 additions & 2 deletions munin/attribute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#ifndef MUNIN_ANSI_ATTRIBUTE_HPP_
#define MUNIN_ANSI_ATTRIBUTE_HPP_

#include "odin/types.hpp"
#include "munin/export.hpp"
#include "odin/core.hpp"
#include "odin/ansi/protocol.hpp"
#include <boost/variant.hpp>
#include <iosfwd>
Expand All @@ -38,7 +39,7 @@ namespace munin {
/// \brief A structure that carries around the presentation attributes of
/// an ANSI element.
//* =========================================================================
struct attribute
struct MUNIN_EXPORT attribute
{
// Structure representing a normal ANSI 16-colour value
struct low_colour
Expand Down
2 changes: 1 addition & 1 deletion munin/basic_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace munin {
/// \brief A default implementation of a component. Only do_draw()
/// and do_get_preferred_size() remain unimplemented.
//* =========================================================================
class basic_component
class MUNIN_EXPORT basic_component
: public component,
public std::enable_shared_from_this<basic_component>
{
Expand Down
2 changes: 1 addition & 1 deletion munin/basic_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace munin {
//* =========================================================================
/// \brief A default implementation of a container.
//* =========================================================================
class basic_container : public container
class MUNIN_EXPORT basic_container : public container
{
public :
//* =====================================================================
Expand Down
2 changes: 1 addition & 1 deletion munin/basic_frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace munin {
/// \brief A class that takes a series of components and uses them to
/// construct a frame.
//* =========================================================================
class basic_frame : public munin::frame
class MUNIN_EXPORT basic_frame : public munin::frame
{
public :
//* =====================================================================
Expand Down
2 changes: 1 addition & 1 deletion munin/button.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace munin {
//* =========================================================================
/// \brief A class that models a push-button.
//* =========================================================================
class button
class MUNIN_EXPORT button
: public munin::composite_component
{
public :
Expand Down
4 changes: 2 additions & 2 deletions munin/canvas.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define MUNIN_CANVAS_HPP_

#include "munin/types.hpp"
#include "odin/types.hpp"
#include "odin/core.hpp"
#include <memory>
#include <utility>

Expand All @@ -37,7 +37,7 @@ namespace munin {
//* =========================================================================
/// \brief An object onto which components can draw themselves.
//* =========================================================================
class canvas
class MUNIN_EXPORT canvas
{
public :
//* =====================================================================
Expand Down
2 changes: 1 addition & 1 deletion munin/card.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace munin {
/// other components, known as "faces". The card displays only one face at
/// a time, and can be commanded to show any of them.
//* =========================================================================
class card
class MUNIN_EXPORT card
: public basic_component
{
public :
Expand Down
2 changes: 1 addition & 1 deletion munin/clock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace munin {
//* =========================================================================
/// \brief A class that models a clock.
//* =========================================================================
class clock
class MUNIN_EXPORT clock
: public munin::composite_component
{
public :
Expand Down
2 changes: 1 addition & 1 deletion munin/compass_layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ BOOST_STATIC_CONSTANT(odin::u32, COMPASS_LAYOUT_WEST = 4);
/// components to the west and east are given their preferred width, while
/// having the height of the containing component.
//* =========================================================================
class compass_layout : public layout
class MUNIN_EXPORT compass_layout : public layout
{
protected :
//* =====================================================================
Expand Down
2 changes: 1 addition & 1 deletion munin/component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class context;
/// A component is a fundamental piece of the munin architecture and is the
/// base class for anything that is capable of being drawn in some way.
//* =========================================================================
class component
class MUNIN_EXPORT component
{
public :
//* =====================================================================
Expand Down
2 changes: 1 addition & 1 deletion munin/composite_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class container;
/// class, which simply forwards functions and messages to and from the
/// underlying container, this can be achieved more easily.
//* =========================================================================
class composite_component
class MUNIN_EXPORT composite_component
: public component
{
public :
Expand Down
2 changes: 1 addition & 1 deletion munin/container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ BOOST_STATIC_CONSTANT(
/// \brief A graphical element capable of containing and arranging other
/// subcomponents.
//* =========================================================================
class container
class MUNIN_EXPORT container
: public component
, public std::enable_shared_from_this<container>
{
Expand Down
3 changes: 2 additions & 1 deletion munin/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#ifndef MUNIN_CONTEXT_HPP_
#define MUNIN_CONTEXT_HPP_

#include "munin/types.hpp"
#include <boost/asio/strand.hpp>
#include <memory>

Expand All @@ -37,7 +38,7 @@ class canvas;
//* =========================================================================
/// \brief A context onto which components can draw themselves.
//* =========================================================================
class context
class MUNIN_EXPORT context
{
public :
//* =====================================================================
Expand Down
2 changes: 1 addition & 1 deletion munin/dropdown_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace munin {
//* =========================================================================
/// \brief A class that models a dropdown_list of items.
//* =========================================================================
class dropdown_list : public munin::composite_component
class MUNIN_EXPORT dropdown_list : public munin::composite_component
{
public :
//* =====================================================================
Expand Down
2 changes: 1 addition & 1 deletion munin/edit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ BOOST_STATIC_CONSTANT(
/// \brief A class that models a single-line text control with a frame
/// bordering it.
//* =========================================================================
class edit
class MUNIN_EXPORT edit
: public munin::basic_component
{
public :
Expand Down
2 changes: 1 addition & 1 deletion munin/filled_box.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static const std::string ATTRIBUTE_LOCK = "Lock";
/// a given element. It allows changing the attribute and glyph of the
/// element independently.
//* =========================================================================
class filled_box : public munin::basic_component
class MUNIN_EXPORT filled_box : public munin::basic_component
{
public :
//* =====================================================================
Expand Down
2 changes: 1 addition & 1 deletion munin/frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace munin {
/// example, to show a border highlight when the interior component has
/// focus.
//* =========================================================================
class frame : public munin::composite_component
class MUNIN_EXPORT frame : public munin::composite_component
{
public :
//* =====================================================================
Expand Down
2 changes: 1 addition & 1 deletion munin/framed_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ BOOST_STATIC_CONSTANT(std::string,
/// \brief A class that models a multi-line text control with a frame
/// bordering it.
//* =========================================================================
class framed_component
class MUNIN_EXPORT framed_component
: public munin::composite_component
{
public :
Expand Down
2 changes: 1 addition & 1 deletion munin/grid_layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace munin {
/// Components added to the grid will be displayed left-to-right, top-to-
/// bottom.
//* =========================================================================
class grid_layout : public layout
class MUNIN_EXPORT grid_layout : public layout
{
public :
//* =====================================================================
Expand Down
2 changes: 1 addition & 1 deletion munin/horizontal_scroll_bar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace munin {
//* =========================================================================
/// \brief A class that models a horizontal scroll bar.
//* =========================================================================
class horizontal_scroll_bar : public basic_component
class MUNIN_EXPORT horizontal_scroll_bar : public basic_component
{
public :
//* =====================================================================
Expand Down
2 changes: 1 addition & 1 deletion munin/horizontal_squeeze_layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace munin {
/// | |
/// +--------+
//* =========================================================================
class horizontal_squeeze_layout
class MUNIN_EXPORT horizontal_squeeze_layout
: public layout
{
protected :
Expand Down
2 changes: 1 addition & 1 deletion munin/horizontal_strip_layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace munin {
/// |+-------+ |
/// +----------+
//* =========================================================================
class horizontal_strip_layout
class MUNIN_EXPORT horizontal_strip_layout
: public layout
{
protected :
Expand Down
2 changes: 1 addition & 1 deletion munin/image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace munin {
/// \brief A class that models a single-line text control with a frame
/// bordering it.
//* =========================================================================
class image : public munin::basic_component
class MUNIN_EXPORT image : public munin::basic_component
{
public :
//* =====================================================================
Expand Down
Loading

0 comments on commit 3674146

Please sign in to comment.