Skip to content
Permalink
Browse files

- implemented str(n)icmp function definitions via CMake macro

  • Loading branch information...
alexey-lysiuk committed Oct 5, 2019
1 parent c09f196 commit 46270326be797bc2493ea53958cd4d3a8b9f50d5
@@ -156,6 +156,22 @@ macro( use_fast_math )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ZD_FASTMATH_FLAG}" )
endmacro()

include( CheckFunctionExists )

macro( require_stricmp )
CHECK_FUNCTION_EXISTS( stricmp STRICMP_EXISTS )
if( NOT STRICMP_EXISTS )
add_definitions( -Dstricmp=strcasecmp )
endif()
endmacro()

macro( require_strnicmp )
CHECK_FUNCTION_EXISTS( strnicmp STRNICMP_EXISTS )
if( NOT STRNICMP_EXISTS )
add_definitions( -Dstrnicmp=strncasecmp )
endif()
endmacro()

option( NO_OPENAL "Disable OpenAL sound support" OFF )

find_package( BZip2 )
@@ -1,24 +1,14 @@
cmake_minimum_required( VERSION 2.8.7 )

use_fast_math()
require_stricmp()
require_strnicmp()

if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -fomit-frame-pointer" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
endif()

include( CheckFunctionExists )

CHECK_FUNCTION_EXISTS( stricmp STRICMP_EXISTS )
if( NOT STRICMP_EXISTS )
add_definitions( -Dstricmp=strcasecmp )
endif()

CHECK_FUNCTION_EXISTS( strnicmp STRNICMP_EXISTS )
if( NOT STRNICMP_EXISTS )
add_definitions( -Dstrnicmp=strncasecmp )
endif()

include_directories( oplsynth )

file( GLOB HEADER_FILES
@@ -1,19 +1,13 @@
cmake_minimum_required( VERSION 2.8.7 )

use_fast_math()
require_stricmp()

if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -fomit-frame-pointer" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
endif()

include( CheckFunctionExists )

CHECK_FUNCTION_EXISTS( stricmp STRICMP_EXISTS )
if( NOT STRICMP_EXISTS )
add_definitions( -Dstricmp=strcasecmp )
endif()

include_directories( timidity )

file( GLOB HEADER_FILES
@@ -1,24 +1,14 @@
cmake_minimum_required( VERSION 2.8.7 )

use_fast_math()
require_stricmp()
require_strnicmp()

if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -fomit-frame-pointer" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
endif()

include( CheckFunctionExists )

CHECK_FUNCTION_EXISTS( stricmp STRICMP_EXISTS )
if( NOT STRICMP_EXISTS )
add_definitions( -Dstricmp=strcasecmp )
endif()

CHECK_FUNCTION_EXISTS( strnicmp STRNICMP_EXISTS )
if( NOT STRNICMP_EXISTS )
add_definitions( -Dstrnicmp=strncasecmp )
endif()

include_directories( wildmidi )

file( GLOB HEADER_FILES
@@ -1,6 +1,8 @@
cmake_minimum_required( VERSION 2.8.7 )

use_fast_math()
require_stricmp()
require_strnicmp()

if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -fomit-frame-pointer" )
@@ -9,16 +11,6 @@ endif()

include( CheckFunctionExists )

CHECK_FUNCTION_EXISTS( stricmp STRICMP_EXISTS )
if( NOT STRICMP_EXISTS )
add_definitions( -Dstricmp=strcasecmp )
endif()

CHECK_FUNCTION_EXISTS( strnicmp STRNICMP_EXISTS )
if( NOT STRNICMP_EXISTS )
add_definitions( -Dstrnicmp=strncasecmp )
endif()

if( DYN_SNDFILE)
add_definitions( -DHAVE_SNDFILE -DDYN_SNDFILE )
else()
@@ -401,15 +401,8 @@ if( NOT STRUPR_EXISTS )
add_definitions( -DNEED_STRUPR=1 )
endif()

CHECK_FUNCTION_EXISTS( stricmp STRICMP_EXISTS )
if( NOT STRICMP_EXISTS )
add_definitions( -Dstricmp=strcasecmp )
endif()

CHECK_FUNCTION_EXISTS( strnicmp STRNICMP_EXISTS )
if( NOT STRNICMP_EXISTS )
add_definitions( -Dstrnicmp=strncasecmp )
endif()
require_stricmp()
require_strnicmp()

if( NOT MSVC )
add_definitions( -D__forceinline=inline )

0 comments on commit 4627032

Please sign in to comment.
You can’t perform that action at this time.