Skip to content

Commit cbd6766

Browse files
committed
feat: define the thread config header via cmake
1 parent 5d951cd commit cbd6766

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
1111
OPTION(ENABLE_THREADS "Enable threads" OFF)
1212

1313
IF(${ENABLE_THREADS})
14+
set(UNQLITE_ENABLE_THREADS ON)
1415
ADD_DEFINITIONS("-DUNQLITE_ENABLE_THREADS")
1516
ENDIF(${ENABLE_THREADS})
1617

18+
configure_file(./src/config.h.in ./src/config.h)
19+
1720
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/src)
1821

1922
SET(HEADERS_UNQLITE

src/config.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _UNQLITE_CONFIG_H_
2+
#define _UNQLITE_CONFIG_H_
3+
4+
/* #undef UNQLITE_ENABLE_THREADS */
5+
6+
#endif

src/config.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _UNQLITE_CONFIG_H_
2+
#define _UNQLITE_CONFIG_H_
3+
4+
#cmakedefine UNQLITE_ENABLE_THREADS
5+
6+
#endif

src/unqlite.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/* This file was automatically generated. Do not edit (Except for compile time directives)! */
22
#ifndef _UNQLITE_H_
33
#define _UNQLITE_H_
4+
5+
#include "./config.h"
6+
47
/*
58
* Symisc UnQLite: An Embeddable NoSQL (Post Modern) Database Engine.
69
* Copyright (C) 2012-2013, Symisc Systems http://unqlite.org/

0 commit comments

Comments
 (0)