Changeset 1299


Ignore:
Timestamp:
Jan 29, 2020 11:10:31 AM (2 months ago)
Author:
stefan
Message:

setup config headers, incl COUENNELIB_EXPORT

Location:
branches/autotools-update/Couenne/src
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/autotools-update/Couenne/src/CouenneConfig.h

    r624 r1299  
    99 * On systems where the code is configured with the configure script
    1010 * (i.e., compilation is always done with HAVE_CONFIG_H defined), this
    11  * header file includes the automatically generated header file, and
    12  * undefines macros that might configure with other Config.h files.
     11 * header file includes the automatically generated header file.
    1312 *
    1413 * On systems that are compiled in other ways (e.g., with the
    15  * Developer Studio), a header files is included to define those
     14 * Developer Studio), a header file is included to define those
    1615 * macros that depend on the operating system and the compiler.  The
    1716 * macros that define the configuration of the particular user setting
    1817 * (e.g., presence of other COIN-OR packages or third party code) are set
    1918 * by the files config_*default.h. The project maintainer needs to remember
    20  * to update these file and choose reasonable defines.
     19 * to update these files and choose reasonable defines.
    2120 * A user can modify the default setting by editing the config_*default.h files.
    22  *
    2321 */
    2422
     
    2725
    2826#ifdef HAVE_CONFIG_H
     27
    2928#ifdef COUENNE_BUILD
    3029#include "config.h"
    3130#else
    3231#include "config_couenne.h"
     32#endif
     33
     34/* overwrite COUENNELIB_EXPORT from config.h when building Couenne
     35 * we want it to be __declspec(dllexport) when building a DLL on Windows
     36 * we want it to be __attribute__((__visibility__("default"))) when building with GCC,
     37 *   so user can compile with -fvisibility=hidden
     38 */
     39#ifdef COUENNE_BUILD
     40#ifdef DLL_EXPORT
     41#undef COUENNELIB_EXPORT
     42#define COUENNELIB_EXPORT __declspec(dllexport)
     43#elif defined(__GNUC__) && __GNUC__ >= 4
     44#undef COUENNELIB_EXPORT
     45#define COUENNELIB_EXPORT __attribute__((__visibility__("default")))
     46#endif
    3347#endif
    3448
  • branches/autotools-update/Couenne/src/config_couenne_default.h

    r1103 r1299  
    1616/* Release Version number of project */
    1717#define COUENNE_VERSION_RELEASE 9999
     18
     19#ifndef COUENNELIB_EXPORT
     20#ifdef _WIN32
     21/* assuming we link against a Bonmin DLL */
     22#define COUENNELIB_EXPORT __declspec(dllimport)
     23#else
     24#define COUENNELIB_EXPORT
     25#endif
     26#endif
  • branches/autotools-update/Couenne/src/config_default.h

    r1293 r1299  
    22/* include the COIN-OR-wide system specific configure header */
    33#include "configall_system.h"
     4
     5/* this needs to come before the include of config_ipopt_default.h */
     6#ifndef COUENNELIB_EXPORT
     7#ifdef _WIN32
     8/* assuming we build an Ipopt DLL */
     9#define COUENNELIB_EXPORT __declspec(dllexport)
     10#else
     11#define COUENNELIB_EXPORT
     12#endif
     13#endif
    414
    515/* include the public project specific macros */
     
    717
    818/***************************************************************************/
    9 /*             HERE DEFINE THE PROJECT SPECIFIC MACROS                     */
     19/*        HERE DEFINE THE PROJECT SPECIFIC PRIVATE MACROS                  */
    1020/*    These are only in effect in a setting that doesn't use configure     */
    1121/***************************************************************************/
Note: See TracChangeset for help on using the changeset viewer.