All: Don't require dllexports.h on standalone builds (really fixes #1464)
Vicki Pfau vi@endrift.com
Mon, 24 Jun 2019 08:30:28 -0700
8 files changed,
17 insertions(+),
10 deletions(-)
M
CMakeLists.txt
→
CMakeLists.txt
@@ -855,6 +855,10 @@ target_include_directories(${BINARY_NAME} BEFORE PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include)
set_target_properties(${BINARY_NAME} PROPERTIES VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_ABI} COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES}" COMPILE_OPTIONS "${FEATURE_FLAGS}") add_dependencies(${BINARY_NAME} version-info) + include(GenerateExportHeader) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/mgba-util) + generate_export_header(${BINARY_NAME} BASE_NAME ${BINARY_NAME} STATIC_DEFINE BUILD_STATIC EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/include/mgba-util/dllexports.h) + target_link_libraries(${BINARY_NAME} ${DEBUGGER_LIB} ${DEPENDENCY_LIB} ${OS_LIB}) install(TARGETS ${BINARY_NAME} LIBRARY DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME} NAMELINK_SKIP ARCHIVE DESTINATION ${LIBDIR} RUNTIME DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME}) if(UNIX AND NOT APPLE AND NOT HAIKU)@@ -906,7 +910,7 @@ if(BUILD_LIBRETRO)
file(GLOB RETRO_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/libretro/*.c) add_library(${BINARY_NAME}_libretro SHARED ${CORE_SRC} ${RETRO_SRC}) add_dependencies(${BINARY_NAME}_libretro version-info) - set_target_properties(${BINARY_NAME}_libretro PROPERTIES PREFIX "" COMPILE_DEFINITIONS "__LIBRETRO__;COLOR_16_BIT;COLOR_5_6_5;DISABLE_THREADING;${OS_DEFINES};${FUNCTION_DEFINES};MINIMAL_CORE=2") + set_target_properties(${BINARY_NAME}_libretro PROPERTIES PREFIX "" COMPILE_DEFINITIONS "__LIBRETRO__;COLOR_16_BIT;COLOR_5_6_5;DISABLE_THREADING;MGBA_STANDALONE;${OS_DEFINES};${FUNCTION_DEFINES};MINIMAL_CORE=2") target_link_libraries(${BINARY_NAME}_libretro ${OS_LIB}) if(MSVC) install(TARGETS ${BINARY_NAME}_libretro RUNTIME DESTINATION ${LIBRETRO_LIBDIR} COMPONENT ${BINARY_NAME}_libretro)@@ -925,7 +929,7 @@ MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/openemu/Info.plist.in
BUNDLE TRUE BUNDLE_EXTENSION oecoreplugin OUTPUT_NAME ${PROJECT_NAME} - COMPILE_DEFINITIONS "DISABLE_THREADING;${OS_DEFINES};${FUNCTION_DEFINES};MINIMAL_CORE=1") + COMPILE_DEFINITIONS "DISABLE_THREADING;MGBA_STANDALONE;${OS_DEFINES};${FUNCTION_DEFINES};MINIMAL_CORE=1") target_link_libraries(${BINARY_NAME}-openemu ${OS_LIB} ${FOUNDATION} ${OPENEMUBASE}) install(TARGETS ${BINARY_NAME}-openemu LIBRARY DESTINATION ${OE_LIBDIR} COMPONENT ${BINARY_NAME}.oecoreplugin NAMELINK_SKIP) endif()@@ -995,11 +999,8 @@ INCLUDE_DIRECTORIES "${SDL_INCLUDE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/src;${CMAKE_CURRENT_SOURCE_DIR}/include")
endif() endif() -include(GenerateExportHeader) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/mgba) -file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/mgba-util) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/core/flags.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/mgba/flags.h) -generate_export_header(${BINARY_NAME} BASE_NAME ${BINARY_NAME} STATIC_DEFINE BUILD_STATIC EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/include/mgba-util/dllexports.h) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/mgba DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT ${BINARY_NAME}-dev FILES_MATCHING PATTERN "*.h") install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/mgba-util DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT ${BINARY_NAME}-dev FILES_MATCHING PATTERN "*.h") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/mgba/flags.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mgba COMPONENT ${BINARY_NAME}-dev)
M
include/mgba-util/common.h
→
include/mgba-util/common.h
@@ -65,6 +65,13 @@ // For PATH_MAX on modern toolchains
#include <sys/syslimits.h> #endif +#ifndef MGBA_STANDALONE +#include <mgba-util/dllexports.h> +#else +#define MGBA_EXPORT +#define MGBA_NO_EXPORT +#endif + #ifndef SSIZE_MAX #define SSIZE_MAX ((ssize_t) (SIZE_MAX >> 1)) #endif
M
include/mgba/core/log.h
→
include/mgba/core/log.h
@@ -7,7 +7,6 @@ #ifndef M_LOG_H
#define M_LOG_H #include <mgba-util/common.h> -#include <mgba-util/dllexports.h> CXX_GUARD_START
M
include/mgba/core/version.h
→
include/mgba/core/version.h
@@ -10,7 +10,11 @@ #ifdef __cplusplus
extern "C" { #endif +#ifdef MGBA_STANDALONE +#define MGBA_EXPORT +#else #include <mgba-util/dllexports.h> +#endif extern MGBA_EXPORT const char* const gitCommit; extern MGBA_EXPORT const char* const gitCommitShort;
M
include/mgba/gba/interface.h
→
include/mgba/gba/interface.h
@@ -7,7 +7,6 @@ #ifndef GBA_INTERFACE_H
#define GBA_INTERFACE_H #include <mgba-util/common.h> -#include <mgba-util/dllexports.h> CXX_GUARD_START
M
include/mgba/internal/gb/io.h
→
include/mgba/internal/gb/io.h
@@ -7,7 +7,6 @@ #ifndef GB_IO_H
#define GB_IO_H #include <mgba-util/common.h> -#include <mgba-util/dllexports.h> CXX_GUARD_START
M
include/mgba/internal/gba/input.h
→
include/mgba/internal/gba/input.h
@@ -7,7 +7,6 @@ #ifndef GBA_INPUT_H
#define GBA_INPUT_H #include <mgba-util/common.h> -#include <mgba-util/dllexports.h> CXX_GUARD_START
M
include/mgba/internal/gba/video.h
→
include/mgba/internal/gba/video.h
@@ -7,7 +7,6 @@ #ifndef GBA_VIDEO_H
#define GBA_VIDEO_H #include <mgba-util/common.h> -#include <mgba-util/dllexports.h> CXX_GUARD_START