8000 Merge pull request #2 from Z80coder/variable-tests · Z80coder/datalog-cpp@e07bc8a · GitHub
[go: up one dir, main page]

Skip to content

Commit e07bc8a

Browse files
authored
Merge pull request #2 from Z80coder/variable-tests
Move to cmake build system
2 parents 1094960 + e448bfe commit e07bc8a

File tree

7 files changed

+99
-375
lines changed

7 files changed

+99
-375
lines changed

Makefile

Lines changed: 0 additions & 40 deletions
This file was deleted.

docs/build.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Overview of the build system
2+
`datalog-cpp` uses the [CMake](www.cmake.org) build tool to generate build files for other build systems. Currently, building using clang and gcc with Makefiles are supported.
3+
4+
# Building with Makefiles
5+
From the command line inside a git clone, run the following:
6+
```
7+
mkdir build
8+
cd build
9+
cmake ../src
10+
make
11+
```
12+
# Building directly with CMake in Visual Studio 2019
13+
Visual Studio 2019 supports using CMake to manage the build directly by selecting File -> Open -> Cmake... and opening `src/CMakeLists.txt`. Then Visual Studio's normal build shortcuts will update the CMake configuration as well as building the project.
14+
15+
CMake options are configured using the `CMakeSettings.json` file, which Visual Studio will generate when `CMakeLists.txt` is opened.
16+
17+
# Build options
18+
Additional configuration variables can be provided in the `cmake` invocation.
19+
20+
For Makefile builds, a build type can be specified by passing `-DCMAKE_BUILD_TYPE=Debug`, `-DCMAKE_BUILD_TYPE=MinSizeRel`, `-DCMAKE_BUILD_TYPE=Release`, or `-DCMAKE_BUILD_TYPE=RelWithDebInfo`. By default, Makefile builds will use `RelWithDebInfo`.

make/dep.py

Lines changed: 0 additions & 169 deletions
This file was deleted.

make/generic.mk

Lines changed: 0 additions & 115 deletions
This file was deleted.

src/CMakeLists.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# CMakeLists.txt
2+
3+
# CMake setup
4+
cmake_minimum_required (VERSION 3.8)
5+
6+
# Set a default build type if none was specified
7+
set(default_build_type "RelWithDebInfo")
8+
9+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
10+
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
11+
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
12+
STRING "Choose the type of build." FORCE)
13+
# Set the possible values of build type for cmake-gui
14+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
15+
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
16+
endif()
17+
18+
# Project initialisation
19+
project("datalog-cpp")
20+
21+
# specify the C++ standard
22+
set(CMAKE_CXX_STANDARD 17)
23+
24+
# types_test target
25+
add_executable(types_test ../tests/types_test.cpp)
26+
target_include_directories(types_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
27+
target_compile_definitions(types_test PUBLIC UNIX)

0 commit comments

Comments
 (0)
0