external/audio_codec_common.cmake
author Ozkan Sezer
Tue, 17 Dec 2019 21:56:50 +0300
changeset 1091 8a09f3c0c340
parent 1050 300088719593
permissions -rw-r--r--
add patch note for Mix_MusicDuration addition
     1 if(${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
     2     set(EMSCRIPTEN 1)
     3 endif()
     4 
     5 if(MSVC)
     6     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
     7     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
     8     add_definitions(-D_CRT_SECURE_NO_WARNINGS)
     9 else()
    10     add_definitions(-Wall)
    11     if(EMSCRIPTEN)
    12         string(REGEX REPLACE "-O3" "-Os" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
    13         string(REGEX REPLACE "-O3" "-Os" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
    14     else()
    15         string(REGEX REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
    16         string(REGEX REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
    17     endif()
    18     set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-omit-frame-pointer")
    19     set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-omit-frame-pointer")
    20 endif()
    21 
    22 if(NOT CMAKE_BUILD_TYPE)
    23     set(CMAKE_BUILD_TYPE "Release")
    24 endif()
    25 
    26 string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
    27 if(CMAKE_BUILD_TYPE_LOWER STREQUAL "release")
    28     add_definitions(-DNDEBUG)
    29 endif()
    30 
    31 # Prevent shared libraries has "lib" prefix on Windows DLL files
    32 if(WIN32)
    33     set(CMAKE_SHARED_LIBRARY_PREFIX "")
    34 endif()
    35