-std=c++17 breaks generate_export_header on macOS
With the following:
cmake_minimum_required(VERSION 3.9)
project(libossia CXX)
set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}")
include(GenerateExportHeader)
add_library(ossia SHARED test.cpp)
set_target_properties(ossia PROPERTIES
CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN 1
)
generate_export_header(ossia BASE_NAME OSSIA)
when there is -std=c++17 the exported header doesn't have the attribute((visiblity="default"))
stuff:
#ifdef OSSIA_STATIC_DEFINE
# define OSSIA_EXPORT
# define OSSIA_NO_EXPORT
#else
# ifndef OSSIA_EXPORT
# ifdef ossia_EXPORTS
/* We are building this library */
# define OSSIA_EXPORT
# else
/* We are using this library */
# define OSSIA_EXPORT
# endif
# endif
when it is not there everything is normal:
#ifdef OSSIA_STATIC_DEFINE
# define OSSIA_EXPORT
# define OSSIA_NO_EXPORT
#else
# ifndef OSSIA_EXPORT
# ifdef ossia_EXPORTS
/* We are building this library */
# define OSSIA_EXPORT __attribute__((visibility("default")))
# else
/* We are using this library */
# define OSSIA_EXPORT __attribute__((visibility("default")))
# endif
# endif
# ifndef OSSIA_NO_EXPORT
# define OSSIA_NO_EXPORT __attribute__((visibility("hidden")))
# endif
#endif