-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
35 lines (30 loc) · 1.41 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
project ( lua_hdrhistogram C )
cmake_minimum_required ( VERSION 2.8 )
include ( cmake/dist.cmake )
include ( lua )
if(MSVC)
# Predefined Macros: http://msdn.microsoft.com/en-us/library/b0084kay.aspx
# Compiler options: http://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx
# set a high warning level and treat them as errors
set(CMAKE_C_FLAGS "/W3 /WX")
# debug multi threaded dll runtime, complete debugging info, runtime error checking
set(CMAKE_C_FLAGS_DEBUG "/MDd /Zi /RTC1")
# multi threaded dll runtime, optimize for speed, auto inlining
set(CMAKE_C_FLAGS_RELEASE "/MD /O2 /Ob2 /DNDEBUG")
else()
# Predefined Macros: clang|gcc -dM -E -x c /dev/null
# Compiler options: http://gcc.gnu.org/onlinedocs/gcc/Invoking-GCC.html#Invoking-GCC
set(CMAKE_C_FLAGS "-std=gnu99 -pedantic -Werror -Wall -Wextra")
if (NOT WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()
set(CMAKE_C_FLAGS_DEBUG "-g")
set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
endif()
add_definitions ( -DDIST_VERSION="${DIST_VERSION}" )
install_lua_module ( hdrhistogram lua_hdrhistogram.c hdr_histogram.c lua_hdrhistogram.def )
install_doc ( README.md )
add_lua_test ( test.lua )