From 9070426ece40e6620d839c9010474bd753935d1d Mon Sep 17 00:00:00 2001 From: wangwenx190 <2546789017@qq.com> Date: Tue, 27 Nov 2018 13:18:30 +0800 Subject: Update FindWindowsSDK.cmake Support latest Win10 SDK. --- cmake/FindWindowsSDK.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmake') diff --git a/cmake/FindWindowsSDK.cmake b/cmake/FindWindowsSDK.cmake index e136b897..4b0e2340 100644 --- a/cmake/FindWindowsSDK.cmake +++ b/cmake/FindWindowsSDK.cmake @@ -73,6 +73,10 @@ macro(_winsdk_announce) endmacro() set(_winsdk_win10vers + 10.0.17763.0 # Windows 10 Version 1809 + 10.0.17134.0 # Windows 10 Version 1803 (April 2018 Update) + 10.0.16299.0 # Windows 10 Version 1709 (Fall Creators Update) + 10.0.15063.0 # Windows 10 Version 1703 (Creators Update) 10.0.14393.0 # Redstone aka Win10 1607 "Anniversary Update" 10.0.10586.0 # TH2 aka Win10 1511 10.0.10240.0 # Win10 RTM -- cgit v1.2.3 From 00ad4a2f5d67b54ec932a8c33f5af2a90b32b46b Mon Sep 17 00:00:00 2001 From: wangwenx190 <2546789017@qq.com> Date: Tue, 27 Nov 2018 13:20:04 +0800 Subject: Update FindWindowsSDK.cmake --- cmake/FindWindowsSDK.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmake') diff --git a/cmake/FindWindowsSDK.cmake b/cmake/FindWindowsSDK.cmake index 4b0e2340..007c9b17 100644 --- a/cmake/FindWindowsSDK.cmake +++ b/cmake/FindWindowsSDK.cmake @@ -73,10 +73,10 @@ macro(_winsdk_announce) endmacro() set(_winsdk_win10vers - 10.0.17763.0 # Windows 10 Version 1809 - 10.0.17134.0 # Windows 10 Version 1803 (April 2018 Update) - 10.0.16299.0 # Windows 10 Version 1709 (Fall Creators Update) - 10.0.15063.0 # Windows 10 Version 1703 (Creators Update) + 10.0.17763.0 # Windows 10 Version 1809 + 10.0.17134.0 # Windows 10 Version 1803 (April 2018 Update) + 10.0.16299.0 # Windows 10 Version 1709 (Fall Creators Update) + 10.0.15063.0 # Windows 10 Version 1703 (Creators Update) 10.0.14393.0 # Redstone aka Win10 1607 "Anniversary Update" 10.0.10586.0 # TH2 aka Win10 1511 10.0.10240.0 # Win10 RTM -- cgit v1.2.3 From c239ae44f827ca3a5bc877b9b19da37e27a0beb7 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 21 Jan 2019 10:21:13 -0800 Subject: Add a FindMySOFA cmake module --- cmake/FindMySOFA.cmake | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 cmake/FindMySOFA.cmake (limited to 'cmake') diff --git a/cmake/FindMySOFA.cmake b/cmake/FindMySOFA.cmake new file mode 100644 index 00000000..dbd7a01b --- /dev/null +++ b/cmake/FindMySOFA.cmake @@ -0,0 +1,60 @@ +# - Find MySOFA +# Find the MySOFA libraries +# +# This module defines the following variables: +# MYSOFA_FOUND - True if MYSOFA_INCLUDE_DIR & MYSOFA_LIBRARY are found +# MYSOFA_INCLUDE_DIRS - where to find mysofa.h, etc. +# MYSOFA_LIBRARIES - the MySOFA library +# + +#============================================================================= +# Copyright 2009-2011 Kitware, Inc. +# Copyright 2009-2011 Philip Lowman +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# * The names of Kitware, Inc., the Insight Consortium, or the names of +# any consortium members, or of any contributors, may not be used to +# endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +find_path(MYSOFA_INCLUDE_DIR NAMES mysofa.h + DOC "The MySOFA include directory" +) + +find_library(MYSOFA_LIBRARY NAMES mysofa + DOC "The MySOFA library" +) + +# handle the QUIETLY and REQUIRED arguments and set MYSOFA_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MYSOFA REQUIRED_VARS MYSOFA_LIBRARY MYSOFA_INCLUDE_DIR) + +if(MYSOFA_FOUND) + set(MYSOFA_LIBRARIES ${MYSOFA_LIBRARY}) + set(MYSOFA_INCLUDE_DIRS ${MYSOFA_INCLUDE_DIR}) +endif() + +mark_as_advanced(MYSOFA_INCLUDE_DIR MYSOFA_LIBRARY) -- cgit v1.2.3 From 5c0dcd1f24a85798ded45abb97bdd80a9d93a8b6 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 22 Jan 2019 13:14:11 -0800 Subject: Fix building makehrtf and sofa-info on Windows --- CMakeLists.txt | 8 ++------ cmake/FindMySOFA.cmake | 25 +++++++++++++++++++++++-- utils/sofa-info.cpp | 2 +- 3 files changed, 26 insertions(+), 9 deletions(-) (limited to 'cmake') diff --git a/CMakeLists.txt b/CMakeLists.txt index 16827594..1c14be46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1523,18 +1523,14 @@ IF(ALSOFT_UTILS) endif() add_executable(makehrtf ${MAKEHRTF_SRCS}) target_compile_definitions(makehrtf PRIVATE ${CPP_DEFS}) - target_include_directories(makehrtf PRIVATE ${MYSOFA_INCLUDE_DIRS}) target_compile_options(makehrtf PRIVATE ${C_FLAGS}) - if(HAVE_LIBM) - target_link_libraries(makehrtf PRIVATE ${LINKER_FLAGS} ${MYSOFA_LIBRARIES} m) - endif() + target_link_libraries(makehrtf PRIVATE ${LINKER_FLAGS} MySOFA::MySOFA) set(SOFAINFO_SRCS utils/sofa-info.cpp) add_executable(sofa-info ${SOFAINFO_SRCS}) target_compile_definitions(sofa-info PRIVATE ${CPP_DEFS}) - target_include_directories(sofa-info PRIVATE ${MYSOFA_INCLUDE_DIRS}) target_compile_options(sofa-info PRIVATE ${C_FLAGS}) - target_link_libraries(sofa-info PRIVATE ${LINKER_FLAGS} ${MYSOFA_LIBRARIES}) + target_link_libraries(sofa-info PRIVATE ${LINKER_FLAGS} MySOFA::MySOFA) endif() IF(ALSOFT_INSTALL) diff --git a/cmake/FindMySOFA.cmake b/cmake/FindMySOFA.cmake index dbd7a01b..a1d57446 100644 --- a/cmake/FindMySOFA.cmake +++ b/cmake/FindMySOFA.cmake @@ -39,6 +39,8 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= +find_package(ZLIB) + find_path(MYSOFA_INCLUDE_DIR NAMES mysofa.h DOC "The MySOFA include directory" ) @@ -47,14 +49,33 @@ find_library(MYSOFA_LIBRARY NAMES mysofa DOC "The MySOFA library" ) +find_library(MYSOFA_M_LIBRARY NAMES m + DOC "The math library for MySOFA" +) + # handle the QUIETLY and REQUIRED arguments and set MYSOFA_FOUND to TRUE if # all listed variables are TRUE include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(MYSOFA REQUIRED_VARS MYSOFA_LIBRARY MYSOFA_INCLUDE_DIR) +find_package_handle_standard_args(MYSOFA REQUIRED_VARS MYSOFA_LIBRARY MYSOFA_INCLUDE_DIR ZLIB_FOUND) if(MYSOFA_FOUND) - set(MYSOFA_LIBRARIES ${MYSOFA_LIBRARY}) set(MYSOFA_INCLUDE_DIRS ${MYSOFA_INCLUDE_DIR}) + set(MYSOFA_LIBRARIES ${MYSOFA_LIBRARY}) + set(MYSOFA_LIBRARIES ${MYSOFA_LIBRARIES} ZLIB::ZLIB) + if(MYSOFA_M_LIBRARY) + set(MYSOFA_LIBRARIES ${MYSOFA_LIBRARIES} ${MYSOFA_M_LIBRARY}) + endif() + + add_library(MySOFA::MySOFA UNKNOWN IMPORTED) + set_property(TARGET MySOFA::MySOFA PROPERTY + IMPORTED_LOCATION ${MYSOFA_LIBRARY}) + set_target_properties(MySOFA::MySOFA PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${MYSOFA_INCLUDE_DIRS} + INTERFACE_LINK_LIBRARIES ZLIB::ZLIB) + if(MYSOFA_M_LIBRARY) + set_property(TARGET MySOFA::MySOFA APPEND PROPERTY + INTERFACE_LINK_LIBRARIES ${MYSOFA_M_LIBRARY}) + endif() endif() mark_as_advanced(MYSOFA_INCLUDE_DIR MYSOFA_LIBRARY) diff --git a/utils/sofa-info.cpp b/utils/sofa-info.cpp index 51dd8b9e..e31ca654 100644 --- a/utils/sofa-info.cpp +++ b/utils/sofa-info.cpp @@ -366,7 +366,7 @@ static void SofaInfo(const char *filename) mysofa_free(sofa.hrtf); } -int main(const int argc, const char *argv[]) +int main(int argc, char *argv[]) { GET_UNICODE_ARGS(&argc, &argv); -- cgit v1.2.3 From ac28b7d0f2110ea36c559edb627c8e02fa49a38f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 10 Jul 2019 18:54:43 -0700 Subject: Use a find module for OpenSL --- CMakeLists.txt | 20 +++++++--------- cmake/FindOpenSL.cmake | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 11 deletions(-) create mode 100644 cmake/FindOpenSL.cmake (limited to 'cmake') diff --git a/CMakeLists.txt b/CMakeLists.txt index 3614ec29..01baa040 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1080,17 +1080,15 @@ ENDIF() # Check for OpenSL (Android) backend OPTION(ALSOFT_REQUIRE_OPENSL "Require OpenSL backend" OFF) -CHECK_INCLUDE_FILES("SLES/OpenSLES.h;SLES/OpenSLES_Android.h" HAVE_SLES_OPENSLES_ANDROID_H) -IF(HAVE_SLES_OPENSLES_ANDROID_H) - CHECK_SHARED_FUNCTION_EXISTS(slCreateEngine "SLES/OpenSLES.h" OpenSLES "" HAVE_LIBOPENSLES) - IF(HAVE_LIBOPENSLES) - OPTION(ALSOFT_BACKEND_OPENSL "Enable OpenSL backend" ON) - IF(ALSOFT_BACKEND_OPENSL) - SET(HAVE_OPENSL 1) - SET(ALC_OBJS ${ALC_OBJS} Alc/backends/opensl.cpp Alc/backends/opensl.h) - SET(BACKENDS "${BACKENDS} OpenSL,") - SET(EXTRA_LIBS OpenSLES ${EXTRA_LIBS}) - ENDIF() +FIND_PACKAGE(OpenSL) +IF(OPENSL_FOUND) + OPTION(ALSOFT_BACKEND_OPENSL "Enable OpenSL backend" ON) + IF(ALSOFT_BACKEND_OPENSL) + SET(HAVE_OPENSL 1) + SET(ALC_OBJS ${ALC_OBJS} Alc/backends/opensl.cpp Alc/backends/opensl.h) + SET(BACKENDS "${BACKENDS} OpenSL,") + SET(EXTRA_LIBS ${OPENSL_LIBRARIES} ${EXTRA_LIBS}) + SET(INC_PATHS ${INC_PATHS} ${OPENSL_INCLUDE_DIRS}) ENDIF() ENDIF() IF(ALSOFT_REQUIRE_OPENSL AND NOT HAVE_OPENSL) diff --git a/cmake/FindOpenSL.cmake b/cmake/FindOpenSL.cmake new file mode 100644 index 00000000..1bd72d10 --- /dev/null +++ b/cmake/FindOpenSL.cmake @@ -0,0 +1,64 @@ +# - Find OpenSL +# Find the OpenSL libraries +# +# This module defines the following variables: +# OPENSL_FOUND - True if OPENSL_INCLUDE_DIR & OPENSL_LIBRARY are set +# OPENSL_INCLUDE_DIRS - where to find SLES/OpenSLES.h, etc. +# OPENSL_LIBRARIES - the OpenSL library +# + +#============================================================================= +# Copyright 2009-2011 Kitware, Inc. +# Copyright 2009-2011 Philip Lowman +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# * The names of Kitware, Inc., the Insight Consortium, or the names of +# any consortium members, or of any contributors, may not be used to +# endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +find_path(OPENSL_INCLUDE_DIR NAMES SLES/OpenSLES.h + DOC "The OpenSL include directory" +) +find_path(OPENSL_ANDROID_INCLUDE_DIR NAMES SLES/OpenSLES_Android.h + DOC "The OpenSL Android include directory" +) + +find_library(OPENSL_LIBRARY NAMES OpenSL + DOC "The OpenSL library" +) + +# handle the QUIETLY and REQUIRED arguments and set OPENSL_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OPENSL REQUIRED_VARS OPENSL_LIBRARY OPENSL_INCLUDE_DIR + OPENSL_ANDROID_INCLUDE_DIR) + +if(OPENSL_FOUND) + set(OPENSL_LIBRARIES ${OPENSL_LIBRARY}) + set(OPENSL_INCLUDE_DIRS ${OPENSL_INCLUDE_DIR} ${OPENSL_ANDROID_INCLUDE_DIR}) +endif() + +mark_as_advanced(OPENSL_INCLUDE_DIR OPENSL_ANDROID_INCLUDE_DIR OPENSL_LIBRARY) -- cgit v1.2.3 From e2f2b74d6a9021d4cc2eff9e8a28543ff3ddb5c0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 10 Jul 2019 19:32:26 -0700 Subject: Get rid of the custom CHECK_SHARED_FUNCTION_EXISTS function --- CMakeLists.txt | 21 ++++---- cmake/CheckSharedFunctionExists.cmake | 92 ----------------------------------- 2 files changed, 9 insertions(+), 104 deletions(-) delete mode 100644 cmake/CheckSharedFunctionExists.cmake (limited to 'cmake') diff --git a/CMakeLists.txt b/CMakeLists.txt index 01baa040..21846be1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,6 @@ SET(CMAKE_MODULE_PATH "${OpenAL_SOURCE_DIR}/cmake") INCLUDE(CheckFunctionExists) INCLUDE(CheckLibraryExists) -INCLUDE(CheckSharedFunctionExists) INCLUDE(CheckIncludeFile) INCLUDE(CheckIncludeFiles) INCLUDE(CheckSymbolExists) @@ -697,8 +696,8 @@ SET(ALC_OBJS Alc/effects/modulator.cpp Alc/effects/null.cpp Alc/effects/pshifter.cpp - Alc/effects/vmorpher.cpp Alc/effects/reverb.cpp + Alc/effects/vmorpher.cpp Alc/filters/biquad.h Alc/filters/biquad.cpp Alc/filters/nfc.cpp @@ -944,16 +943,14 @@ IF(HAVE_WINDOWS_H) # Check MMSystem backend CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H) - IF(HAVE_MMSYSTEM_H) - CHECK_SHARED_FUNCTION_EXISTS(waveOutOpen "windows.h;mmsystem.h" winmm "" HAVE_LIBWINMM) - IF(HAVE_LIBWINMM) - OPTION(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) - IF(ALSOFT_BACKEND_WINMM) - SET(HAVE_WINMM 1) - SET(BACKENDS "${BACKENDS} WinMM,") - SET(ALC_OBJS ${ALC_OBJS} Alc/backends/winmm.cpp Alc/backends/winmm.h) - SET(EXTRA_LIBS winmm ${EXTRA_LIBS}) - ENDIF() + FIND_LIBRARY(WINMM_LIBRARY NAMES winmm) + IF(HAVE_MMSYSTEM_H AND WINMM_LIBRARY) + OPTION(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) + IF(ALSOFT_BACKEND_WINMM) + SET(HAVE_WINMM 1) + SET(BACKENDS "${BACKENDS} WinMM,") + SET(ALC_OBJS ${ALC_OBJS} Alc/backends/winmm.cpp Alc/backends/winmm.h) + SET(EXTRA_LIBS ${WINMM_LIBRARY} ${EXTRA_LIBS}) ENDIF() ENDIF() diff --git a/cmake/CheckSharedFunctionExists.cmake b/cmake/CheckSharedFunctionExists.cmake deleted file mode 100644 index c691fa9c..00000000 --- a/cmake/CheckSharedFunctionExists.cmake +++ /dev/null @@ -1,92 +0,0 @@ -# - Check if a symbol exists as a function, variable, or macro -# CHECK_SYMBOL_EXISTS( ) -# -# Check that the is available after including given header -# and store the result in a . Specify the list -# of files in one argument as a semicolon-separated list. -# -# If the header files define the symbol as a macro it is considered -# available and assumed to work. If the header files declare the -# symbol as a function or variable then the symbol must also be -# available for linking. If the symbol is a type or enum value -# it will not be recognized (consider using CheckTypeSize or -# CheckCSourceCompiles). -# -# The following variables may be set before calling this macro to -# modify the way the check is run: -# -# CMAKE_REQUIRED_FLAGS = string of compile command line flags -# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) -# CMAKE_REQUIRED_INCLUDES = list of include directories -# CMAKE_REQUIRED_LIBRARIES = list of libraries to link - -#============================================================================= -# Copyright 2003-2011 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -MACRO(CHECK_SHARED_FUNCTION_EXISTS SYMBOL FILES LIBRARY LOCATION VARIABLE) - IF(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}") - SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n") - SET(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS}) - IF(CMAKE_REQUIRED_LIBRARIES) - SET(CHECK_SYMBOL_EXISTS_LIBS - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES};${LIBRARY}") - ELSE(CMAKE_REQUIRED_LIBRARIES) - SET(CHECK_SYMBOL_EXISTS_LIBS - "-DLINK_LIBRARIES:STRING=${LIBRARY}") - ENDIF(CMAKE_REQUIRED_LIBRARIES) - IF(CMAKE_REQUIRED_INCLUDES) - SET(CMAKE_SYMBOL_EXISTS_INCLUDES - "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - ELSE(CMAKE_REQUIRED_INCLUDES) - SET(CMAKE_SYMBOL_EXISTS_INCLUDES) - ENDIF(CMAKE_REQUIRED_INCLUDES) - FOREACH(FILE ${FILES}) - SET(CMAKE_CONFIGURABLE_FILE_CONTENT - "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n") - ENDFOREACH(FILE) - SET(CMAKE_CONFIGURABLE_FILE_CONTENT - "${CMAKE_CONFIGURABLE_FILE_CONTENT}\nvoid cmakeRequireSymbol(int dummy,...){(void)dummy;}\nint main()\n{\n cmakeRequireSymbol(0,&${SYMBOL});\n return 0;\n}\n") - - CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" - "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" @ONLY) - - MESSAGE(STATUS "Looking for ${SYMBOL} in ${LIBRARY}") - TRY_COMPILE(${VARIABLE} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c - COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} - CMAKE_FLAGS - -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_SYMBOL_EXISTS_FLAGS} - -DLINK_DIRECTORIES:STRING=${LOCATION} - "${CHECK_SYMBOL_EXISTS_LIBS}" - "${CMAKE_SYMBOL_EXISTS_INCLUDES}" - OUTPUT_VARIABLE OUTPUT) - IF(${VARIABLE}) - MESSAGE(STATUS "Looking for ${SYMBOL} in ${LIBRARY} - found") - SET(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL} in ${LIBRARY}") - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the ${SYMBOL} " - "exist in ${LIBRARY} passed with the following output:\n" - "${OUTPUT}\nFile ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c:\n" - "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") - ELSE(${VARIABLE}) - MESSAGE(STATUS "Looking for ${SYMBOL} in ${LIBRARY} - not found.") - SET(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL} in ${LIBRARY}") - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the ${SYMBOL} " - "exist in ${LIBRARY} failed with the following output:\n" - "${OUTPUT}\nFile ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c:\n" - "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") - ENDIF(${VARIABLE}) - ENDIF(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}") -ENDMACRO(CHECK_SHARED_FUNCTION_EXISTS) -- cgit v1.2.3 From 93d0c8993d22f5944efdca64b1b1905a479a19dc Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 10 Jul 2019 19:55:14 -0700 Subject: Fix OpenSL library name --- cmake/FindOpenSL.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/FindOpenSL.cmake b/cmake/FindOpenSL.cmake index 1bd72d10..41c68fde 100644 --- a/cmake/FindOpenSL.cmake +++ b/cmake/FindOpenSL.cmake @@ -46,7 +46,7 @@ find_path(OPENSL_ANDROID_INCLUDE_DIR NAMES SLES/OpenSLES_Android.h DOC "The OpenSL Android include directory" ) -find_library(OPENSL_LIBRARY NAMES OpenSL +find_library(OPENSL_LIBRARY NAMES OpenSLES DOC "The OpenSL library" ) -- cgit v1.2.3 From becd1cf1bdb91e95b1680a106a5625d42db3b1a8 Mon Sep 17 00:00:00 2001 From: Minmin Gong Date: Thu, 8 Aug 2019 00:07:12 -0700 Subject: Enable to detect Windows SDK v1903 --- cmake/FindWindowsSDK.cmake | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'cmake') diff --git a/cmake/FindWindowsSDK.cmake b/cmake/FindWindowsSDK.cmake index 007c9b17..3fcc3bf4 100644 --- a/cmake/FindWindowsSDK.cmake +++ b/cmake/FindWindowsSDK.cmake @@ -73,10 +73,11 @@ macro(_winsdk_announce) endmacro() set(_winsdk_win10vers - 10.0.17763.0 # Windows 10 Version 1809 - 10.0.17134.0 # Windows 10 Version 1803 (April 2018 Update) - 10.0.16299.0 # Windows 10 Version 1709 (Fall Creators Update) - 10.0.15063.0 # Windows 10 Version 1703 (Creators Update) + 10.0.18362.0 # Windows 10 Version 1903 + 10.0.17763.0 # Windows 10 Version 1809 + 10.0.17134.0 # Windows 10 Version 1803 (April 2018 Update) + 10.0.16299.0 # Windows 10 Version 1709 (Fall Creators Update) + 10.0.15063.0 # Windows 10 Version 1703 (Creators Update) 10.0.14393.0 # Redstone aka Win10 1607 "Anniversary Update" 10.0.10586.0 # TH2 aka Win10 1511 10.0.10240.0 # Win10 RTM @@ -531,11 +532,11 @@ if(WINDOWSSDK_FOUND) winv6.3 # Win 8.1 min requirement ) - list(APPEND _suffixes - "lib/${_ver}/${_winsdk_arch}" - "lib/${_ver}/um/${_winsdk_arch8}" - "lib/${_ver}/km/${_winsdk_arch8}" - ) + list(APPEND _suffixes + "lib/${_ver}/${_winsdk_arch}" + "lib/${_ver}/um/${_winsdk_arch8}" + "lib/${_ver}/km/${_winsdk_arch8}" + ) endforeach() # Look for WDF libraries in Win10+ SDK -- cgit v1.2.3 From 9c95f62e95a76059548762f2e7d2e9bb0e8d4631 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 22 Sep 2019 11:17:31 -0700 Subject: Remove large file macros Large file offsets aren't being utilized, and C++ seems to use to 64-bit offsets anyway. --- CMakeLists.txt | 13 ------------- cmake/CheckFileOffsetBits.c | 9 --------- cmake/CheckFileOffsetBits.cmake | 39 --------------------------------------- 3 files changed, 61 deletions(-) delete mode 100644 cmake/CheckFileOffsetBits.c delete mode 100644 cmake/CheckFileOffsetBits.cmake (limited to 'cmake') diff --git a/CMakeLists.txt b/CMakeLists.txt index 81eb25bf..b9087e95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,6 @@ INCLUDE(CheckCSourceCompiles) INCLUDE(CheckCXXSourceCompiles) INCLUDE(CheckTypeSize) include(CheckStructHasMember) -include(CheckFileOffsetBits) include(GNUInstallDirs) @@ -150,18 +149,6 @@ if(NOT WIN32) UNSET(OLD_REQUIRED_FLAGS) ENDIF() -# Set defines for large file support. Don't set this for Android targets. See: -# https://android-developers.googleblog.com/2017/09/introducing-android-native-development.html -IF(NOT ANDROID) - CHECK_FILE_OFFSET_BITS() - IF(_FILE_OFFSET_BITS) - SET(CPP_DEFS ${CPP_DEFS} "_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS}") - SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS}") - ENDIF() - SET(CPP_DEFS ${CPP_DEFS} _LARGEFILE_SOURCE _LARGE_FILES) - SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_LARGEFILE_SOURCE -D_LARGE_FILES") -ENDIF() - # C99 has restrict, but C++ does not, so we can only utilize __restrict. SET(RESTRICT_DECL ) CHECK_CXX_SOURCE_COMPILES("int *__restrict foo; diff --git a/cmake/CheckFileOffsetBits.c b/cmake/CheckFileOffsetBits.c deleted file mode 100644 index de98296e..00000000 --- a/cmake/CheckFileOffsetBits.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define KB ((off_t)(1024)) -#define MB ((off_t)(KB*1024)) -#define GB ((off_t)(MB*1024)) -int tb[((GB+GB+GB) > GB) ? 1 : -1]; - -int main() -{ return 0; } diff --git a/cmake/CheckFileOffsetBits.cmake b/cmake/CheckFileOffsetBits.cmake deleted file mode 100644 index 1dc154e4..00000000 --- a/cmake/CheckFileOffsetBits.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# - Check if the _FILE_OFFSET_BITS macro is needed for large files -# CHECK_FILE_OFFSET_BITS() -# -# The following variables may be set before calling this macro to -# modify the way the check is run: -# -# CMAKE_REQUIRED_FLAGS = string of compile command line flags -# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) -# CMAKE_REQUIRED_INCLUDES = list of include directories -# Copyright (c) 2009, Chris Robinson -# -# Redistribution and use is allowed according to the terms of the LGPL license. - - -MACRO(CHECK_FILE_OFFSET_BITS) - - IF(NOT DEFINED _FILE_OFFSET_BITS) - MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files") - TRY_COMPILE(__WITHOUT_FILE_OFFSET_BITS_64 - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CheckFileOffsetBits.c - COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}) - IF(NOT __WITHOUT_FILE_OFFSET_BITS_64) - TRY_COMPILE(__WITH_FILE_OFFSET_BITS_64 - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CheckFileOffsetBits.c - COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_FILE_OFFSET_BITS=64) - ENDIF(NOT __WITHOUT_FILE_OFFSET_BITS_64) - - IF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64) - SET(_FILE_OFFSET_BITS 64 CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files") - MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files - 64") - ELSE(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64) - SET(_FILE_OFFSET_BITS "" CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files") - MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files - not needed") - ENDIF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64) - ENDIF(NOT DEFINED _FILE_OFFSET_BITS) - -ENDMACRO(CHECK_FILE_OFFSET_BITS) \ No newline at end of file -- cgit v1.2.3