From 51c5fa94aa9592d2c25209b94b6cbe4349850cbd Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 22 Dec 2007 13:35:52 -0800 Subject: Check for snprintf, and use _snprintf when needed --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dea95a6..ea296b72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,16 @@ IF(NOT "${HAVE_STRCASECMP}") ADD_DEFINITIONS(-Dstrcasecmp=_stricmp) ENDIF() +CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF) +IF(NOT "${HAVE_SNPRINTF}") + CHECK_FUNCTION_EXISTS(_snprintf HAVE__SNPRINTF) + IF(NOT "${HAVE__SNPRINTF}") + MESSAGE(FATAL_ERROR "No snprintf function found, please report!") + ENDIF() + + ADD_DEFINITIONS(-Dsnprintf=_snprintf) +ENDIF() + # Check for the dlopen API (for dynamicly loading backend libs) IF(DLOPEN) CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H) -- cgit v1.2.3 From a48201ed94225ab103164b7a95946c1e6a586e69 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 23 Dec 2007 16:27:05 -0800 Subject: Fix target opts to remove prefix on the win32 dll CMake didn't like the previous attempt --- CMakeLists.txt | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ea296b72..5f107e5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,15 +33,6 @@ SET(LIB_BUILD_VERSION "38") SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_BUILD_VERSION}") -IF("${WIN32}") - SET(LIBNAME openal32) - SET(TARGET_OPTS "PREFIX \"\"") -ELSE() - SET(LIBNAME openal) - SET(TARGET_OPTS "") -ENDIF() - - CHECK_TYPE_SIZE("long" SIZEOF_LONG) CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG) CHECK_TYPE_SIZE("unsigned int" SIZEOF_UINT) @@ -267,10 +258,18 @@ CONFIGURE_FILE( ADD_DEFINITIONS(-DAL_BUILD_LIBRARY) # Build a shared library +IF("${WIN32}") + SET(LIBNAME openal32) +ELSE() + SET(LIBNAME openal) +ENDIF() + ADD_LIBRARY(${LIBNAME} SHARED ${OPENAL_OBJS} ${ALC_OBJS}) SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES VERSION ${LIB_VERSION} - SOVERSION ${LIB_MAJOR_VERSION} - ${TARGET_OPTS}) + SOVERSION ${LIB_MAJOR_VERSION}) +IF("${WIN32}") + SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES PREFIX "") +ENDIF() TARGET_LINK_LIBRARIES(${LIBNAME} ${EXTRA_LIBS}) -- cgit v1.2.3 From 2ee389044bc6ff1a8b066eb70f41cc8ec883f5fa Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 23 Dec 2007 16:28:09 -0800 Subject: Check for libm before including it --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f107e5d..d7093fa5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,6 @@ CHECK_TYPE_SIZE("void*" SIZEOF_VOIDP) # Add definitions, compiler switches, etc. INCLUDE_DIRECTORIES(OpenAL32/Include include "${OpenAL_BINARY_DIR}") -SET(EXTRA_LIBS m ${EXTRA_LIBS}) IF("${MSVC}") # ??? @@ -94,6 +93,9 @@ ELSEIF(NODEBUG) ENDIF() CHECK_LIBRARY_EXISTS(m sqrtf "" HAVE_SQRTF) +IF("${HAVE_SQRTF}") + SET(EXTRA_LIBS m ${EXTRA_LIBS}) +ENDIF() CHECK_FUNCTION_EXISTS(strtof HAVE_STRTOF) CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP) -- cgit v1.2.3