Skip to content
Snippets Groups Projects
Commit 4aa742a5 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

For MSVC build collection of pragmas is introduced to suppress warnings

parent dd59fee6
No related branches found
No related tags found
No related merge requests found
Showing
with 140 additions and 35 deletions
...@@ -8,7 +8,7 @@ project(BornAgain) ...@@ -8,7 +8,7 @@ project(BornAgain)
# --- General project settings --- # --- General project settings ---
if(NOT BORNAGAIN_PYTHON) if(NOT BORNAGAIN_PYTHON)
set(BORNAGAIN_PYTHON ON) # set(BORNAGAIN_PYTHON ON)
endif() endif()
set(BORNAGAIN_APP OFF) set(BORNAGAIN_APP OFF)
set(BORNAGAIN_GUI OFF) set(BORNAGAIN_GUI OFF)
...@@ -27,15 +27,15 @@ include(CheckCompiler) ...@@ -27,15 +27,15 @@ include(CheckCompiler)
#--- Recurse into the given subdirectories --- #--- Recurse into the given subdirectories ---
add_subdirectory(Core) add_subdirectory(Core)
add_subdirectory(ThirdParty/gtest) #add_subdirectory(ThirdParty/gtest)
add_subdirectory(Tests/UnitTests/TestCore) #add_subdirectory(Tests/UnitTests/TestCore)
add_subdirectory(ThirdParty/RootMinimizers) #add_subdirectory(ThirdParty/RootMinimizers)
add_subdirectory(Fit) #add_subdirectory(Fit)
# functional tests (cmake; make check) # functional tests (cmake; make check)
add_subdirectory(Tests/FunctionalTests) #add_subdirectory(Tests/FunctionalTests)
#if(ROOT_FOUND AND BORNAGAIN_APP) #if(ROOT_FOUND AND BORNAGAIN_APP)
# add_subdirectory(App) # add_subdirectory(App)
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#ifndef BEAM_H_ #ifndef BEAM_H_
#define BEAM_H_ #define BEAM_H_
#include "WinDllMacros.h"
#include "Types.h" #include "Types.h"
#include "IParameterized.h" #include "IParameterized.h"
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#ifndef CONVOLUTIONDETECTORRESOLUTION_H_ #ifndef CONVOLUTIONDETECTORRESOLUTION_H_
#define CONVOLUTIONDETECTORRESOLUTION_H_ #define CONVOLUTIONDETECTORRESOLUTION_H_
#include "WinDllMacros.h"
#include "IDetectorResolution.h" #include "IDetectorResolution.h"
#include "IResolutionFunction2D.h" #include "IResolutionFunction2D.h"
...@@ -34,7 +33,6 @@ class BA_CORE_API_ ConvolutionDetectorResolution : public IDetectorResolution ...@@ -34,7 +33,6 @@ class BA_CORE_API_ ConvolutionDetectorResolution : public IDetectorResolution
//! Constructor taking a 2 dimensional resolution function as argument //! Constructor taking a 2 dimensional resolution function as argument
ConvolutionDetectorResolution(IResolutionFunction2D *p_res_function_2d); ConvolutionDetectorResolution(IResolutionFunction2D *p_res_function_2d);
ConvolutionDetectorResolution(const IResolutionFunction2D &p_res_function_2d); ConvolutionDetectorResolution(const IResolutionFunction2D &p_res_function_2d);
//! Destructor
virtual ~ConvolutionDetectorResolution(); virtual ~ConvolutionDetectorResolution();
//! Convolve given intensities with the encapsulated resolution. //! Convolve given intensities with the encapsulated resolution.
...@@ -55,9 +53,6 @@ class BA_CORE_API_ ConvolutionDetectorResolution : public IDetectorResolution ...@@ -55,9 +53,6 @@ class BA_CORE_API_ ConvolutionDetectorResolution : public IDetectorResolution
virtual void init_parameters(); virtual void init_parameters();
private: private:
// //! hiding copy constructor and disabling assignment operator
// ConvolutionDetectorResolution& operator=(const ConvolutionDetectorResolution& );
void apply1dConvolution(OutputData<double> *p_intensity_map) const; void apply1dConvolution(OutputData<double> *p_intensity_map) const;
void apply2dConvolution(OutputData<double> *p_intensity_map) const; void apply2dConvolution(OutputData<double> *p_intensity_map) const;
double getIntegratedPDF1d(double x, double step) const; double getIntegratedPDF1d(double x, double step) const;
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#ifndef DETECTOR_H_ #ifndef DETECTOR_H_
#define DETECTOR_H_ #define DETECTOR_H_
#include "WinDllMacros.h"
#include "IDetectorResolution.h" #include "IDetectorResolution.h"
#include "DetectorParameters.h" #include "DetectorParameters.h"
#include "SafePointerVector.h" #include "SafePointerVector.h"
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#ifndef ICHISQUAREDMODULE_H_ #ifndef ICHISQUAREDMODULE_H_
#define ICHISQUAREDMODULE_H_ #define ICHISQUAREDMODULE_H_
#include "WinDllMacros.h"
#include "IFittingDataSelector.h" #include "IFittingDataSelector.h"
#include "ISquaredFunction.h" #include "ISquaredFunction.h"
#include "IOutputDataNormalizer.h" #include "IOutputDataNormalizer.h"
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#ifndef IOUTPUTDATANORMALIZER_H #ifndef IOUTPUTDATANORMALIZER_H
#define IOUTPUTDATANORMALIZER_H #define IOUTPUTDATANORMALIZER_H
#include "WinDllMacros.h"
#include "IParameterized.h" #include "IParameterized.h"
#include "OutputData.h" #include "OutputData.h"
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#ifndef INSTRUMENT_H_ #ifndef INSTRUMENT_H_
#define INSTRUMENT_H_ #define INSTRUMENT_H_
#include "WinDllMacros.h"
#include "Beam.h" #include "Beam.h"
#include "Detector.h" #include "Detector.h"
#include "IResolutionFunction2D.h" #include "IResolutionFunction2D.h"
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#ifndef MASK_H_ #ifndef MASK_H_
#define MASK_H_ #define MASK_H_
#include "WinDllMacros.h"
#include "MaskCoordinateFunction.h" #include "MaskCoordinateFunction.h"
//! Base class for masking OutputData elements. //! Base class for masking OutputData elements.
......
...@@ -17,11 +17,10 @@ ...@@ -17,11 +17,10 @@
#ifndef MASKCOORDINATEFUNCTION_H_ #ifndef MASKCOORDINATEFUNCTION_H_
#define MASKCOORDINATEFUNCTION_H_ #define MASKCOORDINATEFUNCTION_H_
#include "WinDllMacros.h"
#include <cstddef> #include <cstddef>
#include "ICloneable.h" #include "ICloneable.h"
//! ? //! base class for all kind of OutputData's masks
class MaskCoordinateFunction : public ICloneable class MaskCoordinateFunction : public ICloneable
{ {
...@@ -38,7 +37,7 @@ class MaskCoordinateFunction : public ICloneable ...@@ -38,7 +37,7 @@ class MaskCoordinateFunction : public ICloneable
bool m_invert; //!< if true, the complement is masked instead bool m_invert; //!< if true, the complement is masked instead
}; };
//! ? //! rectangular mask for OutputData
class BA_CORE_API_ MaskCoordinateRectangleFunction : public MaskCoordinateFunction class BA_CORE_API_ MaskCoordinateRectangleFunction : public MaskCoordinateFunction
{ {
...@@ -55,7 +54,7 @@ class BA_CORE_API_ MaskCoordinateRectangleFunction : public MaskCoordinateFuncti ...@@ -55,7 +54,7 @@ class BA_CORE_API_ MaskCoordinateRectangleFunction : public MaskCoordinateFuncti
int *m_maxima; int *m_maxima;
}; };
//! ? //! ellipse shaped mask for OutputData
class BA_CORE_API_ MaskCoordinateEllipseFunction : public MaskCoordinateFunction class BA_CORE_API_ MaskCoordinateEllipseFunction : public MaskCoordinateFunction
{ {
......
...@@ -23,6 +23,17 @@ file(GLOB source_files ...@@ -23,6 +23,17 @@ file(GLOB source_files
"Tools/src/*.cpp" "Tools/src/*.cpp"
) )
file(GLOB include_files
"Algorithms/inc/*.h"
"FormFactors/inc/*.h"
"Geometry/inc/*.h"
"Samples/inc/*.h"
"StandardSamples/*.h"
"Tools/inc/*.h"
)
#source_group(headers FILES ${include_files})
if(BORNAGAIN_PYTHON) if(BORNAGAIN_PYTHON)
file(GLOB pythonapi "PythonAPI/src/*.cpp" "PythonAPI/inc/__call_policies.pypp.hpp") file(GLOB pythonapi "PythonAPI/src/*.cpp" "PythonAPI/inc/__call_policies.pypp.hpp")
list(APPEND source_files ${pythonapi}) list(APPEND source_files ${pythonapi})
...@@ -39,7 +50,7 @@ endif() ...@@ -39,7 +50,7 @@ endif()
add_library( add_library(
${library_name} ${library_name}
SHARED SHARED
${source_files} ${source_files} ${include_files}
) )
set_Target_properties(${library_name} PROPERTIES PREFIX ${libprefix} SUFFIX ${libsuffix}) set_Target_properties(${library_name} PROPERTIES PREFIX ${libprefix} SUFFIX ${libsuffix})
set(${library_name}_LIBRARY_TYPE SHARED) set(${library_name}_LIBRARY_TYPE SHARED)
...@@ -61,7 +72,7 @@ target_link_libraries(${library_name} ${PYTHON_LIBRARIES}) ...@@ -61,7 +72,7 @@ target_link_libraries(${library_name} ${PYTHON_LIBRARIES})
# ${CMAKE_BINARY_DIR}/lib/ # ${CMAKE_BINARY_DIR}/lib/
#) #)
# python in windows required .yd extention for the library name # python in windows required .pyd extention for the library name
if(WIN32 AND BORNAGAIN_PYTHON) if(WIN32 AND BORNAGAIN_PYTHON)
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
TARGET ${library_name} TARGET ${library_name}
......
...@@ -19,6 +19,13 @@ ...@@ -19,6 +19,13 @@
#include "WinDllMacros.h" #include "WinDllMacros.h"
#include <stdexcept> #include <stdexcept>
#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4275)
#endif
#endif
namespace Exceptions { namespace Exceptions {
class BA_CORE_API_ NotImplementedException : public std::logic_error class BA_CORE_API_ NotImplementedException : public std::logic_error
...@@ -118,6 +125,14 @@ namespace Exceptions { ...@@ -118,6 +125,14 @@ namespace Exceptions {
using namespace Exceptions; using namespace Exceptions;
#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif
#endif // EXCEPTIONS_H #endif // EXCEPTIONS_H
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
//! Interface for one-dimensional axes //! Interface for one-dimensional axes
class IAxis class BA_CORE_API_ IAxis
{ {
public: public:
//! constructors //! constructors
......
...@@ -16,11 +16,12 @@ ...@@ -16,11 +16,12 @@
#ifndef INAMED_H #ifndef INAMED_H
#define INAMED_H #define INAMED_H
#include "WinDllMacros.h"
#include <string> #include <string>
//! Standard mix-in for all objects that have a name. //! Standard mix-in for all objects that have a name.
class INamed class BA_CORE_API_ INamed
{ {
public: public:
//! Default constructor, setting name="". //! Default constructor, setting name="".
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "ICloneable.h" #include "ICloneable.h"
class IStochasticParameter : public ICloneable class BA_CORE_API_ IStochasticParameter : public ICloneable
{ {
public: public:
virtual ~IStochasticParameter() {} virtual ~IStochasticParameter() {}
...@@ -26,7 +26,7 @@ class IStochasticParameter : public ICloneable ...@@ -26,7 +26,7 @@ class IStochasticParameter : public ICloneable
virtual void setToAverage()=0; virtual void setToAverage()=0;
}; };
template <class T> class StochasticParameter : public IStochasticParameter template <class T> class BA_CORE_API_ StochasticParameter : public IStochasticParameter
{ {
public: public:
StochasticParameter(T average); StochasticParameter(T average);
......
/* @(#)build/win:$Id$ */
/*************************************************************************
* Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_w32pragma
#define ROOT_w32pragma
/*************************************************************************
* *
* w32pragma *
* *
* Pragmas and defines for MSVC *
* *
*************************************************************************/
#ifdef _WIN32
/* Disable warning about truncated symboles (usually coming from stl) */
#pragma warning (disable: 4786)
/* Disable warning about inconsistent dll linkage (dllexport assumed) */
#pragma warning (disable: 4273)
/* "no suitable definition provided for explicit template instantiation"*/
#pragma warning (disable: 4661)
/* "deprecated, use ISO C++ conformant name" */
#pragma warning (disable: 4996)
/* "new behavior: elements default initialized" */
#pragma warning (disable: 4351)
/* local static not thread safe */
#pragma warning (disable: 4640)
/*forcing int to bool (performance warning) */
#pragma warning (disable: 4800)
/* truncation from double to float */
#pragma warning (disable: 4305)
/* signed unsigned mismatch */
#pragma warning (disable: 4018)
/* truncation of constant value */
#pragma warning (disable: 4309)
/* check op precedence for error */
#pragma warning (disable: 4554)
/* qualifier applied to reference type; ignored */
#pragma warning (disable: 4181)
/* /GS can not buffer overrun protect parameters and locals: function not optimized */
#pragma warning (disable: 4748)
/* function(): resolved overload was found by argument-dependent lookup */
#pragma warning (disable: 4675)
/* X needs to have dll-interface to be used by clients of class Y */
#pragma warning (disable: 4251)
/* decorated name length exceeded, name was truncated */
#pragma warning (disable: 4503)
/* function is hidden */
#pragma warning (3: 4266)
/* loop control variable is used outside the for-loop scope */
#pragma warning (3: 4289)
#define WIN32 1
#define _WINDOWS 1
#define WINVER 0x0400
#define CRTAPI1 _cdecl
#define CRTAPI2 _cdecl
#define _X86_ 1
// #define _DLL - used to be explicitly defined,
// but it's implicitely defined via /MD(d)
#define G__REDIRECTIO 1
#define G__SHAREDLIB 1
#define G__UNIX 1
#define G__ROOT 1
#define G__WIN32 1
#if (_MSC_VER >= 1310)
# define G__NEWSTDHEADER 1
#endif
#if (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#define _USE_ATTRIBUTES_FOR_SAL 0
#endif
#endif // _WIN32
#endif // defined ROOT_w32pragma
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "MultiLayer.h" #include "MultiLayer.h"
#include "ParticleDecoration.h" #include "ParticleDecoration.h"
#include "Particle.h" #include "Particle.h"
#include "ParticleInfo.h"
#include "ParticleCoreShell.h" #include "ParticleCoreShell.h"
#include "InterferenceFunction1DParaCrystal.h" #include "InterferenceFunction1DParaCrystal.h"
#include "InterferenceFunction2DParaCrystal.h" #include "InterferenceFunction2DParaCrystal.h"
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "Particle.h" #include "Particle.h"
#include "InterferenceFunction1DParaCrystal.h" #include "InterferenceFunction1DParaCrystal.h"
#include "InterferenceFunction2DParaCrystal.h" #include "InterferenceFunction2DParaCrystal.h"
#include "ParticleInfo.h"
#include <iostream> #include <iostream>
......
...@@ -20,13 +20,8 @@ set(ROOT_PLATFORM win32) ...@@ -20,13 +20,8 @@ set(ROOT_PLATFORM win32)
#set(CMAKE_C_FLAGS_RELEASE "-O2") #set(CMAKE_C_FLAGS_RELEASE "-O2")
#set(CMAKE_C_FLAGS_DEBUG "-Od -Z7") #set(CMAKE_C_FLAGS_DEBUG "-Od -Z7")
#if(winrtdebug) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
# set(BLDCXXFLAGS "-MDd -GR") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
# set(BLDCFLAGS "-MDd")
#else()
# set(BLDCXXFLAGS "-MD -GR")
# set(BLDCFLAGS "-MD")
#endif()
#if(CMAKE_PROJECT_NAME STREQUAL ROOT) #if(CMAKE_PROJECT_NAME STREQUAL ROOT)
# set(CMAKE_CXX_FLAGS "-nologo -I${CMAKE_SOURCE_DIR}/build/win -FIw32pragma.h -FIsehmap.h ${BLDCXXFLAGS} -EHsc- -W3 -wd4244 -D_WIN32") # set(CMAKE_CXX_FLAGS "-nologo -I${CMAKE_SOURCE_DIR}/build/win -FIw32pragma.h -FIsehmap.h ${BLDCXXFLAGS} -EHsc- -W3 -wd4244 -D_WIN32")
...@@ -47,4 +42,10 @@ set(ROOT_PLATFORM win32) ...@@ -47,4 +42,10 @@ set(ROOT_PLATFORM win32)
#set(CMAKE_C_OUTPUT_EXTENSION ".o") #set(CMAKE_C_OUTPUT_EXTENSION ".o")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mincoming-stack-boundary=2 -Wno-unused-local-typedefs -Wno-attributes") if (MSVC)
message("XXX ${MSVC}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mincoming-stack-boundary=2 -FIw32pragma.h")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mincoming-stack-boundary=2 -Wno-unused-local-typedefs -Wno-attributes")
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment