From c9cfd31b2979f23282e359a0bc4e2106fb685320 Mon Sep 17 00:00:00 2001 From: Jonas Erlandsson Date: Tue, 27 Dec 2011 12:37:02 +0100 Subject: [PATCH] Linux compat changes. Removed line 4-6 in CMake/InstallDependencies.cmake so Linux also get the macros. Edited DependenciesSource/.../CMakeLists.txt to add -fPIC compiler option on Linux 64bit. Edited all Examples/.../CMakeLists.txt to rename "Main.cpp" to "main.cpp". Edited cAudio/include/cSTLAllocator.h to make the inclusion of cstddef.h explicit for gcc 2.6+. Despite this you still need to copy Dependencies/include/OpenAL/alc.h to /usr/include/AL/alc.h (for Ubuntu or whatever path that is on your system) for it to compile if you are not running the development build of OpenAL. --- CMake/InstallDependencies.cmake | 5 +---- DependenciesSource/libogg-1.2.2/CMakeLists.txt | 5 ++++- DependenciesSource/libvorbis-1.3.2/CMakeLists.txt | 5 +++++ Examples/Tutorial1_2DSound/CMakeLists.txt | 2 +- Examples/Tutorial2_3DSound/CMakeLists.txt | 2 +- Examples/Tutorial3_MemoryPlayback/CMakeLists.txt | 2 +- Examples/Tutorial4_AudioCapture/CMakeLists.txt | 2 +- Examples/Tutorial5_AudioEffects/CMakeLists.txt | 2 +- Examples/Tutorial6_CustomEventHandler/CMakeLists.txt | 2 +- Examples/Tutorial7_CustomLogReceiver/CMakeLists.txt | 2 +- cAudio/include/cSTLAllocator.h | 1 + 11 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CMake/InstallDependencies.cmake b/CMake/InstallDependencies.cmake index 97dde07..62a222d 100644 --- a/CMake/InstallDependencies.cmake +++ b/CMake/InstallDependencies.cmake @@ -1,9 +1,6 @@ ##################################################### # Install dependencies ##################################################### -if (NOT APPLE AND NOT WIN32) - return() -endif() option(CAUDIO_COPY_DEPENDENCIES "Copy dependency libs to the build directory" TRUE) @@ -94,4 +91,4 @@ if (CAUDIO_COPY_DEPENDENCIES) copy_debug(wrap_oal.dll) copy_release(wrap_oal.dll) endif () -endif () \ No newline at end of file +endif () diff --git a/DependenciesSource/libogg-1.2.2/CMakeLists.txt b/DependenciesSource/libogg-1.2.2/CMakeLists.txt index 0ebe6af..ce75494 100644 --- a/DependenciesSource/libogg-1.2.2/CMakeLists.txt +++ b/DependenciesSource/libogg-1.2.2/CMakeLists.txt @@ -12,11 +12,14 @@ include(libogg_src_files) add_library(Ogg STATIC ${file_root}) target_link_libraries(Ogg) +if(UNIX AND CMAKE_SIZEOF_VOID_P EQUAL 8) + set_target_properties( Ogg PROPERTIES COMPILE_FLAGS -fPIC) +endif() + if (APPLE AND CAUDIO_IOS_BUILD) set_target_properties(Ogg PROPERTIES XCODE_ATTRIBUTE_GCC_THUMB_SUPPORT "NO") set_target_properties(Ogg PROPERTIES XCODE_ATTRIBUTE_GCC_UNROLL_LOOPS "YES") set_target_properties(Ogg PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer") - endif() install_all_targets(Ogg) diff --git a/DependenciesSource/libvorbis-1.3.2/CMakeLists.txt b/DependenciesSource/libvorbis-1.3.2/CMakeLists.txt index 483bb53..9183b89 100644 --- a/DependenciesSource/libvorbis-1.3.2/CMakeLists.txt +++ b/DependenciesSource/libvorbis-1.3.2/CMakeLists.txt @@ -11,6 +11,11 @@ include(libvorbis_src_files) add_library(Vorbis STATIC ${file_root}) target_link_libraries(Vorbis Ogg) + +if(UNIX AND CMAKE_SIZEOF_VOID_P EQUAL 8) + set_target_properties( Vorbis PROPERTIES COMPILE_FLAGS -fPIC) +endif() + add_dependencies(Vorbis Ogg) if (APPLE AND CAUDIO_IOS_BUILD) diff --git a/Examples/Tutorial1_2DSound/CMakeLists.txt b/Examples/Tutorial1_2DSound/CMakeLists.txt index 5a765a7..a778637 100644 --- a/Examples/Tutorial1_2DSound/CMakeLists.txt +++ b/Examples/Tutorial1_2DSound/CMakeLists.txt @@ -9,7 +9,7 @@ PROJECT(Tutorial1_2DSound) set (SOURCE_FILES - src/Main.cpp + src/main.cpp ) if(CAUDIO_IOS_BUILD) diff --git a/Examples/Tutorial2_3DSound/CMakeLists.txt b/Examples/Tutorial2_3DSound/CMakeLists.txt index 2a19c0f..77290d7 100644 --- a/Examples/Tutorial2_3DSound/CMakeLists.txt +++ b/Examples/Tutorial2_3DSound/CMakeLists.txt @@ -9,7 +9,7 @@ PROJECT(Tutorial1_3DSound) set (SOURCE_FILES - src/Main.cpp + src/main.cpp ) if(CAUDIO_IOS_BUILD) diff --git a/Examples/Tutorial3_MemoryPlayback/CMakeLists.txt b/Examples/Tutorial3_MemoryPlayback/CMakeLists.txt index d356029..aa52b22 100644 --- a/Examples/Tutorial3_MemoryPlayback/CMakeLists.txt +++ b/Examples/Tutorial3_MemoryPlayback/CMakeLists.txt @@ -10,7 +10,7 @@ PROJECT(Tutorial3_MemoryPlayback) set (SOURCE_FILES include/bling.h - src/Main.cpp + src/main.cpp ) if(CAUDIO_IOS_BUILD) diff --git a/Examples/Tutorial4_AudioCapture/CMakeLists.txt b/Examples/Tutorial4_AudioCapture/CMakeLists.txt index 06be195..d5fd95f 100644 --- a/Examples/Tutorial4_AudioCapture/CMakeLists.txt +++ b/Examples/Tutorial4_AudioCapture/CMakeLists.txt @@ -9,7 +9,7 @@ PROJECT(Tutorial4_AudioCapture) set (SOURCE_FILES - src/Main.cpp + src/main.cpp ) if(CAUDIO_IOS_BUILD) diff --git a/Examples/Tutorial5_AudioEffects/CMakeLists.txt b/Examples/Tutorial5_AudioEffects/CMakeLists.txt index ad60a75..02073c4 100644 --- a/Examples/Tutorial5_AudioEffects/CMakeLists.txt +++ b/Examples/Tutorial5_AudioEffects/CMakeLists.txt @@ -9,7 +9,7 @@ PROJECT(Tutorial5_AudioEffects) set (SOURCE_FILES - src/Main.cpp + src/main.cpp ) if(CAUDIO_IOS_BUILD) diff --git a/Examples/Tutorial6_CustomEventHandler/CMakeLists.txt b/Examples/Tutorial6_CustomEventHandler/CMakeLists.txt index b8d6de2..a43e9ac 100644 --- a/Examples/Tutorial6_CustomEventHandler/CMakeLists.txt +++ b/Examples/Tutorial6_CustomEventHandler/CMakeLists.txt @@ -11,7 +11,7 @@ PROJECT(Tutorial6_CustomEventHandler) set (SOURCE_FILES include/cTestHandler.h src/cTestHandler.cpp - src/Main.cpp + src/main.cpp ) if(CAUDIO_IOS_BUILD) diff --git a/Examples/Tutorial7_CustomLogReceiver/CMakeLists.txt b/Examples/Tutorial7_CustomLogReceiver/CMakeLists.txt index aa8a66d..4b1f268 100644 --- a/Examples/Tutorial7_CustomLogReceiver/CMakeLists.txt +++ b/Examples/Tutorial7_CustomLogReceiver/CMakeLists.txt @@ -11,7 +11,7 @@ PROJECT(Tutorial7_CustomLogReceiver) set (SOURCE_FILES include/cTestLogReceiver.h src/cTestLogReceiver.cpp - src/Main.cpp + src/main.cpp ) if(CAUDIO_IOS_BUILD) diff --git a/cAudio/include/cSTLAllocator.h b/cAudio/include/cSTLAllocator.h index 77fe9a3..6454c62 100644 --- a/cAudio/include/cSTLAllocator.h +++ b/cAudio/include/cSTLAllocator.h @@ -13,6 +13,7 @@ #include #include #include +#include namespace cAudio {