Skip to content

Commit

Permalink
Merge pull request #2431 from johnhaddon/symbolVisibility
Browse files Browse the repository at this point in the history
Symbol visibility
  • Loading branch information
johnhaddon authored Feb 5, 2018
2 parents 71f4af4 + 8e0910f commit e05c681
Show file tree
Hide file tree
Showing 850 changed files with 4,772 additions and 3,748 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ os:
- linux
- osx

# Force Ubuntu Precise until we can determine the source
# of test failures on Trusty.
dist: precise
dist: trusty

addons:
apt:
Expand Down
32 changes: 23 additions & 9 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ options.Add(
options.Add(
"CXXFLAGS",
"The extra flags to pass to the C++ compiler during compilation.",
[ "-pipe", "-Wall", "-Werror" ]
[ "-pipe", "-Wall" ]
)

options.Add(
Expand All @@ -98,6 +98,10 @@ options.Add(
"c++11",
)

options.Add(
BoolVariable( "WARNINGS_AS_ERRORS", "Treat compiler and linker warnings as errors.", True )
)

options.Add(
"LINKFLAGS",
"The extra flags to pass to the C++ linker during compilation.",
Expand Down Expand Up @@ -386,13 +390,19 @@ elif env["PLATFORM"] == "posix" :

env["GAFFER_PLATFORM"] = "linux"

env.Append( CXXFLAGS = [ "-std=$CXXSTD" ] )
env.Append( CXXFLAGS = [ "-std=$CXXSTD", "-fvisibility=hidden" ] )

if env["DEBUG"] :
env.Append( CXXFLAGS = [ "-g", "-O0" ] )
else :
env.Append( CXXFLAGS = [ "-DNDEBUG", "-DBOOST_DISABLE_ASSERTS" , "-O3" ] )

if env["WARNINGS_AS_ERRORS"] :
env.Append(
CXXFLAGS = [ "-Werror" ],
SHLINKFLAGS = [ "-Wl,-fatal_warnings" ],
)

if env["BUILD_CACHEDIR"] != "" :
CacheDir( env["BUILD_CACHEDIR"] )

Expand Down Expand Up @@ -653,7 +663,7 @@ libraries = {

"GafferScene" : {
"envAppends" : {
"LIBS" : [ "Gaffer", "Iex$OPENEXR_LIB_SUFFIX", "IECoreGL$CORTEX_LIB_SUFFIX", "IECoreAlembic$CORTEX_LIB_SUFFIX", "IECoreImage$CORTEX_LIB_SUFFIX", "IECoreScene$CORTEX_LIB_SUFFIX", "GafferImage", "GafferDispatch" ],
"LIBS" : [ "Gaffer", "Iex$OPENEXR_LIB_SUFFIX", "IECoreGL$CORTEX_LIB_SUFFIX", "IECoreImage$CORTEX_LIB_SUFFIX", "IECoreScene$CORTEX_LIB_SUFFIX", "GafferImage", "GafferDispatch" ],
},
"pythonEnvAppends" : {
"LIBS" : [ "GafferBindings", "GafferScene", "GafferDispatch", "IECoreScene$CORTEX_LIB_SUFFIX" ],
Expand Down Expand Up @@ -697,7 +707,7 @@ libraries = {
"LIBS" : [ "Gaffer", "GafferImage", "OpenImageIO$OIIO_LIB_SUFFIX", ],
},
"pythonEnvAppends" : {
"LIBS" : [ "GafferImageTest", "GafferImage" ],
"LIBS" : [ "GafferImage" ],
},
"additionalFiles" : glob.glob( "python/GafferImageTest/scripts/*" ) + glob.glob( "python/GafferImageTest/images/*" ) + glob.glob( "python/GafferImageTest/openColorIO/luts/*" ) + glob.glob( "python/GafferImageTest/openColorIO/*" ),
},
Expand Down Expand Up @@ -928,6 +938,7 @@ for libraryName, libraryDef in libraries.items() :
# environment

libEnv = baseLibEnv.Clone()
libEnv.Append( CXXFLAGS = "-D{0}_EXPORTS".format( libraryName ) )
libEnv.Append( **(libraryDef.get( "envAppends", {} )) )

# library
Expand Down Expand Up @@ -964,22 +975,25 @@ for libraryName, libraryDef in libraries.items() :
pythonEnv = basePythonEnv.Clone()
pythonEnv.Append( **(libraryDef.get( "pythonEnvAppends", {} )) )

bindingsEnv = pythonEnv.Clone()
bindingsEnv.Append( CXXFLAGS = "-D{0}BINDINGS_EXPORTS".format( libraryName ) )

bindingsSource = sorted( glob.glob( "src/" + libraryName + "Bindings/*.cpp" ) )
if bindingsSource :

bindingsLibrary = pythonEnv.SharedLibrary( "lib/" + libraryName + "Bindings", bindingsSource )
pythonEnv.Default( bindingsLibrary )
bindingsLibrary = bindingsEnv.SharedLibrary( "lib/" + libraryName + "Bindings", bindingsSource )
bindingsEnv.Default( bindingsLibrary )

bindingsLibraryInstall = pythonEnv.Install( "$BUILD_DIR/lib", bindingsLibrary )
bindingsLibraryInstall = bindingsEnv.Install( "$BUILD_DIR/lib", bindingsLibrary )
env.Alias( "build", bindingsLibraryInstall )

# header install
bindingsHeaderInstall = pythonEnv.Install(
bindingsHeaderInstall = bindingsEnv.Install(
"$BUILD_DIR/" + "include/" + libraryName + "Bindings",
glob.glob( "include/" + libraryName + "Bindings/*.h" ) +
glob.glob( "include/" + libraryName + "Bindings/*.inl" )
)
pythonEnv.Alias( "build", bindingsHeaderInstall )
bindingsEnv.Alias( "build", bindingsHeaderInstall )


pythonModuleSource = sorted( glob.glob( "src/" + libraryName + "Module/*.cpp" ) )
Expand Down
2 changes: 1 addition & 1 deletion config/travis/installDependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# get the prebuilt dependencies package and unpack it into the build directory

downloadURL = "https://github.com/GafferHQ/dependencies/releases/download/0.43.0.0/gafferDependencies-0.43.0.0-" + platform + ".tar.gz"
downloadURL = "https://github.com/GafferHQ/dependencies/releases/download/0.44.0.0/gafferDependencies-0.44.0.0-" + platform + ".tar.gz"

sys.stderr.write( "Downloading dependencies \"%s\"" % downloadURL )
tarFileName, headers = urllib.urlretrieve( downloadURL )
Expand Down
7 changes: 4 additions & 3 deletions include/Gaffer/Action.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
#ifndef GAFFER_ACTION_H
#define GAFFER_ACTION_H

#include <functional>
#include "Gaffer/Export.h"
#include "Gaffer/TypeIds.h"

#include "IECore/RunTimeTyped.h"

#include "Gaffer/TypeIds.h"
#include <functional>

namespace Gaffer
{
Expand All @@ -64,7 +65,7 @@ IE_CORE_FORWARDDECLARE( Action );
/// back to the ScriptNode - this would result in a circular reference,
/// preventing the ScriptNode from being deleted appropriately. It is essential
/// that great care is taken with this when implementing subclasses.
class Action : public IECore::RunTimeTyped
class GAFFER_API Action : public IECore::RunTimeTyped
{

public :
Expand Down
2 changes: 1 addition & 1 deletion include/Gaffer/Animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace Gaffer
{

/// Node for applying keyframed animation to plugs.
class Animation : public ComputeNode
class GAFFER_API Animation : public ComputeNode
{

public :
Expand Down
2 changes: 1 addition & 1 deletion include/Gaffer/ApplicationRoot.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace Gaffer

IE_CORE_FORWARDDECLARE( Preferences )

class ApplicationRoot : public GraphComponent
class GAFFER_API ApplicationRoot : public GraphComponent
{

public :
Expand Down
6 changes: 3 additions & 3 deletions include/Gaffer/ArrayPlug.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
#ifndef GAFFER_ARRAYPLUG_H
#define GAFFER_ARRAYPLUG_H

#include "OpenEXR/ImathLimits.h"

#include "Gaffer/Plug.h"

#include "OpenEXR/ImathLimits.h"

namespace Gaffer
{

/// The ArrayPlug maintains a sequence of identically-typed child
/// plugs, automatically adding new plugs when all existing plugs
/// have connections.
class ArrayPlug : public Plug
class GAFFER_API ArrayPlug : public Plug
{

public :
Expand Down
2 changes: 1 addition & 1 deletion include/Gaffer/Backdrop.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ IE_CORE_FORWARDDECLARE( StringPlug )

/// The Backdrop node has no computational purpose - it is merely a placeholder
/// for an organisation tool in the user interface, implemented in GafferUI::BackdropNodeGadget.
class Backdrop : public Node
class GAFFER_API Backdrop : public Node
{

public :
Expand Down
6 changes: 4 additions & 2 deletions include/Gaffer/BlockedConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@
#ifndef GAFFER_BLOCKEDCONNECTION_H
#define GAFFER_BLOCKEDCONNECTION_H

#include "boost/signals.hpp"
#include "Gaffer/Export.h"

#include "boost/noncopyable.hpp"
#include "boost/signals.hpp"

namespace Gaffer
{

/// The BlockedConnection class allows connections to be blocked and unblocked
/// in an exception-safe manner.
class BlockedConnection : boost::noncopyable
class GAFFER_API BlockedConnection : boost::noncopyable
{

public :
Expand Down
2 changes: 1 addition & 1 deletion include/Gaffer/Box.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ IE_CORE_FORWARDDECLARE( Set )

/// A Box is simply a Node which is intended to hold other Nodes
/// as children.
class Box : public SubGraph
class GAFFER_API Box : public SubGraph
{

public :
Expand Down
2 changes: 1 addition & 1 deletion include/Gaffer/BoxIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ IE_CORE_FORWARDDECLARE( Box )
/// The BoxIO constructor is protected. Construct
/// the derived BoxIn and BoxOut classes rather than
/// attempt to construct BoxIO itself.
class BoxIO : public Node
class GAFFER_API BoxIO : public Node
{

public :
Expand Down
2 changes: 1 addition & 1 deletion include/Gaffer/BoxIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
namespace Gaffer
{

class BoxIn : public BoxIO
class GAFFER_API BoxIn : public BoxIO
{

public :
Expand Down
2 changes: 1 addition & 1 deletion include/Gaffer/BoxOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
namespace Gaffer
{

class BoxOut : public BoxIO
class GAFFER_API BoxOut : public BoxIO
{

public :
Expand Down
9 changes: 6 additions & 3 deletions include/Gaffer/BoxPlug.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,20 @@
#ifndef GAFFER_BOXPLUG_H
#define GAFFER_BOXPLUG_H

#include "OpenEXR/ImathBox.h"
#include "Gaffer/CompoundNumericPlug.h"

#include "IECore/BoxTraits.h"
#include "IECore/Export.h"

#include "Gaffer/CompoundNumericPlug.h"
IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/ImathBox.h"
IECORE_POP_DEFAULT_VISIBILITY

namespace Gaffer
{

template<typename T>
class BoxPlug : public ValuePlug
class GAFFER_API BoxPlug : public ValuePlug
{

public :
Expand Down
2 changes: 1 addition & 1 deletion include/Gaffer/ChildSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace Gaffer

/// The ChildSet is a Set implementation where the membership automatically
/// tracks the children of a GraphComponent.
class ChildSet : public Gaffer::Set
class GAFFER_API ChildSet : public Gaffer::Set
{

public :
Expand Down
6 changes: 3 additions & 3 deletions include/Gaffer/CompoundDataPlug.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
#ifndef GAFFER_COMPOUNDDATAPLUG_H
#define GAFFER_COMPOUNDDATAPLUG_H

#include "Gaffer/TypedPlug.h"

#include "IECore/CompoundData.h"
#include "IECore/CompoundObject.h"

#include "Gaffer/TypedPlug.h"

namespace Gaffer
{

Expand All @@ -51,7 +51,7 @@ IE_CORE_FORWARDDECLARE( StringPlug )
/// This plug provides an easy means of building CompoundData containing
/// arbitrary keys and values, where each key and value is represented
/// by an individual child plug.
class CompoundDataPlug : public Gaffer::ValuePlug
class GAFFER_API CompoundDataPlug : public Gaffer::ValuePlug
{

public :
Expand Down
11 changes: 7 additions & 4 deletions include/Gaffer/CompoundNumericPlug.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@
#ifndef GAFFER_COMPOUNDNUMERICPLUG_H
#define GAFFER_COMPOUNDNUMERICPLUG_H

#include "OpenEXR/ImathVec.h"
#include "OpenEXR/ImathColor.h"
#include "Gaffer/NumericPlug.h"

#include "IECore/Export.h"
#include "IECore/GeometricTypedData.h"

#include "Gaffer/NumericPlug.h"
IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/ImathColor.h"
#include "OpenEXR/ImathVec.h"
IECORE_POP_DEFAULT_VISIBILITY

namespace Gaffer
{

template<typename T>
class CompoundNumericPlug : public ValuePlug
class GAFFER_API CompoundNumericPlug : public ValuePlug
{

public :
Expand Down
2 changes: 1 addition & 1 deletion include/Gaffer/CompoundPathFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace Gaffer

/// The CompoundPathFilter class simply combines a number of other
/// PathFilters, applying them in sequence.
class CompoundPathFilter : public Gaffer::PathFilter
class GAFFER_API CompoundPathFilter : public Gaffer::PathFilter
{

public :
Expand Down
6 changes: 3 additions & 3 deletions include/Gaffer/ComputeNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
#ifndef GAFFER_COMPUTENODE_H
#define GAFFER_COMPUTENODE_H

#include "IECore/MurmurHash.h"

#include "Gaffer/DependencyNode.h"

#include "IECore/MurmurHash.h"

namespace Gaffer
{

Expand All @@ -53,7 +53,7 @@ IE_CORE_FORWARDDECLARE( Context )
/// methods defined by the ComputeNode. ComputeNode computations are threadsafe (multiple
/// threads may call getValue() with multiple Contexts concurrently) and make use
/// of an in-memory caching mechanism to avoid repeated computations of the same thing.
class ComputeNode : public DependencyNode
class GAFFER_API ComputeNode : public DependencyNode
{

public :
Expand Down
11 changes: 6 additions & 5 deletions include/Gaffer/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@
#ifndef GAFFER_CONTEXT_H
#define GAFFER_CONTEXT_H

#include "boost/container/flat_map.hpp"
#include "boost/signals.hpp"
#include "Gaffer/Export.h"
#include "Gaffer/StringAlgo.h"

#include "IECore/InternedString.h"
#include "IECore/Data.h"
#include "IECore/InternedString.h"
#include "IECore/MurmurHash.h"

#include "Gaffer/StringAlgo.h"
#include "boost/container/flat_map.hpp"
#include "boost/signals.hpp"

namespace Gaffer
{
Expand All @@ -69,7 +70,7 @@ namespace Gaffer
/// avoid unnecessary recomputation. In the future we may explore having the UI use a separate
/// container for such variables, or a more general mechanism for variables guaranteed to be
/// unrelated to computation.
class Context : public IECore::RefCounted
class GAFFER_API Context : public IECore::RefCounted
{

public :
Expand Down
Loading

0 comments on commit e05c681

Please sign in to comment.