diff --git a/.gitignore b/.gitignore index fdf5da0..10e30ec 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,6 @@ source/android-lib/.externalNativeBuild # CMake build directory build* +CMakeFiles +CMakeCache.txt +*.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c8ecc4..6c5c92e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,12 @@ if(SOUNDTOUCH_DLL) source/SoundTouchDLL/SoundTouchDLL.cpp source/SoundTouchDLL/SoundTouchDLL.rc ) + target_compile_options(SoundTouch PRIVATE -fPIC) + set_target_properties(SoundTouchDLL PROPERTIES CXX_VISIBILITY_PRESET hidden) + target_compile_options(SoundTouchDLL PRIVATE -Ofast) + target_compile_definitions(SoundTouchDLL PRIVATE CMAKE) target_include_directories(SoundTouchDLL PUBLIC $) + target_link_libraries(SoundTouchDLL PRIVATE SoundTouch) install(FILES source/SoundTouchDLL/SoundTouchDLL.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/soundtouch") install(TARGETS SoundTouchDLL EXPORT SoundTouchTargets) endif() @@ -42,6 +47,7 @@ if(WIN32 AND BUILD_SHARED_LIBS) endif() endif() +target_compile_options(SoundTouch PRIVATE -Ofast) target_compile_definitions(SoundTouch PRIVATE CMAKE) option(INTEGER_SAMPLES "Use integers instead of floats for samples" OFF) diff --git a/source/SoundTouchDLL/SoundTouchDLL.h b/source/SoundTouchDLL/SoundTouchDLL.h index 5932dc8..2024854 100644 --- a/source/SoundTouchDLL/SoundTouchDLL.h +++ b/source/SoundTouchDLL/SoundTouchDLL.h @@ -48,7 +48,7 @@ #else // GNU version - #ifdef DLL_EXPORTS + #if defined(DLL_EXPORTS) || defined(SoundTouchDLL_EXPORTS) // GCC declaration for exporting functions #define SOUNDTOUCHDLL_API extern "C" __attribute__((__visibility__("default"))) #else