Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 3 additions & 45 deletions conf/gkbuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,17 @@ include(CheckIncludeFile)

# Setup options.
option(GDB "enable use of GDB" OFF)
option(ASSERT "turn asserts on" OFF)
option(ASSERT2 "additional assertions" OFF)
option(DEBUG "add debugging support" OFF)
option(GPROF "add gprof support" OFF)
option(VALGRIND "add valgrind support" OFF)
option(OPENMP "enable OpenMP support" OFF)
option(PCRE "enable PCRE support" OFF)
option(GKREGEX "enable GKREGEX support" OFF)
option(GKRAND "enable GKRAND support" OFF)


# Add compiler flags.
if(MSVC)
set(GK_COPTS "/Ox")
set(GK_COPTIONS "-DWIN32 -DMSC -D_CRT_SECURE_NO_DEPRECATE -DUSE_GKREGEX")
elseif(MINGW)
set(GK_COPTS "-DUSE_GKREGEX")
else()
set(GK_COPTIONS "-DWIN32 -DMSC -D_CRT_SECURE_NO_DEPRECATE")
elseif(NOT MINGW)
set(GK_COPTIONS "-DLINUX -D_FILE_OFFSET_BITS=64")
endif(MSVC)
if(CYGWIN)
Expand Down Expand Up @@ -72,56 +66,20 @@ endif(OPENMP)

# Add various definitions.
if(GDB)
set(GK_COPTS "${GK_COPTS} -g")
set(GK_COPTIONS "${GK_COPTIONS} -Werror")
else()
set(GK_COPTS "-O3")
endif(GDB)


if(DEBUG)
set(GK_COPTS "-Og")
set(GK_COPTIONS "${GK_COPTIONS} -DDEBUG")
endif(DEBUG)

if(GPROF)
set(GK_COPTS "-pg")
endif(GPROF)

if(NOT ASSERT)
set(GK_COPTIONS "${GK_COPTIONS} -DNDEBUG")
endif(NOT ASSERT)

if(NOT ASSERT2)
set(GK_COPTIONS "${GK_COPTIONS} -DNDEBUG2")
endif(NOT ASSERT2)


# Add various options
if(PCRE)
set(GK_COPTIONS "${GK_COPTIONS} -D__WITHPCRE__")
endif(PCRE)

if(GKREGEX)
set(GK_COPTIONS "${GK_COPTIONS} -DUSE_GKREGEX")
endif(GKREGEX)

if(GKRAND)
set(GK_COPTIONS "${GK_COPTIONS} -DUSE_GKRAND")
endif(GKRAND)


# Check for features.
check_include_file(execinfo.h HAVE_EXECINFO_H)
if(HAVE_EXECINFO_H)
set(GK_COPTIONS "${GK_COPTIONS} -DHAVE_EXECINFO_H")
endif(HAVE_EXECINFO_H)

check_function_exists(getline HAVE_GETLINE)
if(HAVE_GETLINE)
set(GK_COPTIONS "${GK_COPTIONS} -DHAVE_GETLINE")
endif(HAVE_GETLINE)


# Custom check for TLS.
if(MSVC)
Expand Down