Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -538,12 +538,16 @@ endif()

###############################################################################
# Compiler and system specific options
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)

if(UNIX)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIC -fno-strict-aliasing")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fno-strict-aliasing")

# all warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -fno-strict-aliasing -Winvalid-pch -Wnon-virtual-dtor -Wno-narrowing")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-strict-aliasing -Winvalid-pch -Wnon-virtual-dtor -Wno-narrowing")
# TODO: temp for gcc-11 which throws narrowing conversions in Path_GTest.cpp due to int codepoints
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing")
# Treat all warnings as errors
Expand Down
6 changes: 6 additions & 0 deletions csharp/CSharpAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define CSHARP_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# ifdef openstudio_csharp_EXPORTS
# define CSHARP_API __attribute__((visibility("default")))
# else
# define CSHARP_API
# endif
#else
# define CSHARP_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions ruby/module/RubyAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
# else
# define RUBY_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_rb_EXPORTS) || defined(openstudio_modeleditor_rb_EXPORTS)
# define RUBY_API __attribute__((visibility("default")))
# else
# define RUBY_API
# endif
#else
# define RUBY_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/airflow/AirflowAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define AIRFLOW_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_airflow_EXPORTS) || defined(openstudio_EXPORTS)
# define AIRFLOW_API __attribute__((visibility("default")))
# else
# define AIRFLOW_API
# endif
#else
# define AIRFLOW_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/airflow/WindPressure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

#if _WIN32 || _MSC_VER
# define WIND_API __declspec(dllexport)
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_airflow_EXPORTS) || defined(openstudio_EXPORTS)
# define WIND_API __attribute__((visibility("default")))
# else
# define WIND_API
# endif
#else
# define WIND_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/alfalfa/AlfalfaAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define ALFALFA_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_alfalfa_EXPORTS) || defined(openstudio_EXPORTS)
# define ALFALFA_API __attribute__((visibility("default")))
# else
# define ALFALFA_API
# endif
#else
# define ALFALFA_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/energyplus/EnergyPlusAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define ENERGYPLUS_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_energyplus_EXPORTS) || defined(openstudio_EXPORTS)
# define ENERGYPLUS_API __attribute__((visibility("default")))
# else
# define ENERGYPLUS_API
# endif
#else
# define ENERGYPLUS_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/epjson/epJSONAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define EPJSON_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_epjson_EXPORTS) || defined(openstudio_EXPORTS)
# define EPJSON_API __attribute__((visibility("default")))
# else
# define EPJSON_API
# endif
#else
# define EPJSON_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/gbxml/gbXMLAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define GBXML_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_gbxml_EXPORTS) || defined(openstudio_EXPORTS)
# define GBXML_API __attribute__((visibility("default")))
# else
# define GBXML_API
# endif
#else
# define GBXML_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/gltf/GltfAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define GLTF_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_gltf_EXPORTS) || defined(openstudio_EXPORTS)
# define GLTF_API __attribute__((visibility("default")))
# else
# define GLTF_API
# endif
#else
# define GLTF_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/isomodel/ISOModelAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define ISOMODEL_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_isomodel_EXPORTS) || defined(openstudio_EXPORTS)
# define ISOMODEL_API __attribute__((visibility("default")))
# else
# define ISOMODEL_API
# endif
#else
# define ISOMODEL_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/measure/MeasureAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define MEASURE_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_measure_EXPORTS) || defined(openstudio_EXPORTS)
# define MEASURE_API __attribute__((visibility("default")))
# else
# define MEASURE_API
# endif
#else
# define MEASURE_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/model/ModelAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define MODEL_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_model_EXPORTS) || defined(openstudio_EXPORTS)
# define MODEL_API __attribute__((visibility("default")))
# else
# define MODEL_API
# endif
#else
# define MODEL_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/modelica/ModelicaAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
# else
# define MODELICA_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_modelica_EXPORTS) || defined(openstudio_EXPORTS)
# define MODELICA_API __attribute__((visibility("default")))
# else
# define MODELICA_API
# endif
#else
# define MODELICA_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/osversion/OSVersionAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define OSVERSION_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_osversion_EXPORTS) || defined(openstudio_EXPORTS)
# define OSVERSION_API __attribute__((visibility("default")))
# else
# define OSVERSION_API
# endif
#else
# define OSVERSION_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/radiance/RadianceAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define RADIANCE_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_radiance_EXPORTS) || defined(openstudio_EXPORTS)
# define RADIANCE_API __attribute__((visibility("default")))
# else
# define RADIANCE_API
# endif
#else
# define RADIANCE_API
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/sdd/SDDAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# else
# define SDD_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) || defined(__clang__)
# if defined(openstudio_sdd_EXPORTS) || defined(openstudio_EXPORTS)
# define SDD_API __attribute__((visibility("default")))
# else
# define SDD_API
# endif
#else
# define SDD_API
#endif
Expand Down
10 changes: 10 additions & 0 deletions src/utilities/UtilitiesAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@

# endif

#elif defined(__GNUC__) || defined(__clang__)

# if defined(openstudio_utilities_EXPORTS) || defined(openstudio_EXPORTS)
# define UTILITIES_API __attribute__((visibility("default")))
# define UTILITIES_TEMPLATE_EXT
# else
# define UTILITIES_API
# define UTILITIES_TEMPLATE_EXT extern
# endif

#else

# define UTILITIES_API
Expand Down
Loading