Skip to content
Merged
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
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cmake_minimum_required(VERSION 3.13...3.19)

set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)

if (VCPKG_LIBSNDFILE)
list(APPEND VCPKG_MANIFEST_FEATURES "vcpkg-libsndfile")
endif()
Expand Down
1 change: 1 addition & 0 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# added as interface sources. Thus whatever links to zmusic-obj will be in
# charge of compiling. As a result any properties set on zmusic-obj should be
# interface.

add_library(zmusic-obj INTERFACE)
target_sources(zmusic-obj
INTERFACE
Expand Down
15 changes: 10 additions & 5 deletions source/zmusic/zmusic_internal.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#pragma once
#define ZMUSIC_INTERNAL

#if defined(_MSC_VER) && !defined(ZMUSIC_STATIC)
#define DLL_EXPORT __declspec(dllexport)
#define DLL_IMPORT __declspec(dllexport) // without this the compiler complains.
#if !defined(ZMUSIC_STATIC)
#if defined(_MSC_VER)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MinGW/MinGW-w64 does the absolutely same, so please use _WIN32 here.

#define DLL_EXPORT __declspec(dllexport)
#define DLL_IMPORT __declspec(dllexport) // without this the compiler complains.
#else
#define DLL_EXPORT __attribute__((visibility("default")))
#define DLL_IMPORT
#endif
#else
#define DLL_EXPORT
#define DLL_IMPORT
#define DLL_EXPORT
#define DLL_IMPORT
#endif

typedef class MIDISource *ZMusic_MidiSource;
Expand Down
5 changes: 3 additions & 2 deletions thirdparty/game-music-emu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ if (COMPILER_IS_GNUCXX_COMPATIBLE)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -Wextra")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

# Assume we have visibility support on any compiler that supports C++11
add_definitions (-DLIBGME_VISIBILITY)
# Assume we have visibility support on any compiler that supports C++11
# [ZMusic] we do not want to export this interface, so do not unhide the API functions.
#add_definitions (-DLIBGME_VISIBILITY)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")

# Try to protect against undefined behavior from signed integer overflow
Expand Down
1 change: 1 addition & 0 deletions thirdparty/game-music-emu/gme/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set(libgme_SRCS Blip_Buffer.cpp
Effects_Buffer.cpp
Fir_Resampler.cpp
gme.cpp
gme.h
Gme_File.cpp
M3u_Playlist.cpp
Multi_Buffer.cpp
Expand Down