summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 82d0e33..e668751 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,7 @@ include(CheckFunctionExists)
include(CheckSymbolExists)
PROJECT(ucode C)
-ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -ffunction-sections -D_GNU_SOURCE)
+ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -ffunction-sections -fwrapv -D_GNU_SOURCE)
IF(CMAKE_C_COMPILER_VERSION VERSION_GREATER 6)
ADD_DEFINITIONS(-Wextra -Werror=implicit-function-declaration)
@@ -66,6 +66,11 @@ IF (NOT DLOPEN_FUNCTION_EXISTS)
TARGET_LINK_LIBRARIES(libucode dl)
ENDIF()
+CHECK_FUNCTION_EXISTS(fmod FMOD_FUNCTION_EXISTS)
+IF (NOT FMOD_FUNCTION_EXISTS)
+ TARGET_LINK_LIBRARIES(libucode m)
+ENDIF()
+
SET(CMAKE_REQUIRED_LIBRARIES json-c)
CHECK_SYMBOL_EXISTS(json_object_array_shrink "json.h" HAVE_ARRAY_SHRINK)
IF(HAVE_ARRAY_SHRINK)