Skip to content

Move to cmake build system #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
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
40 changes: 0 additions & 40 deletions Makefile

This file was deleted.

20 changes: 20 additions & 0 deletions docs/build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Overview of the build system
`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.

# Building with Makefiles
From the command line inside a git clone, run the following:
```
mkdir build
cd build
cmake ../src
make
```
# Building directly with CMake in Visual Studio 2019
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.

CMake options are configured using the `CMakeSettings.json` file, which Visual Studio will generate when `CMakeLists.txt` is opened.

# Build options
Additional configuration variables can be provided in the `cmake` invocation.

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`.
169 changes: 0 additions & 169 deletions make/dep.py

This file was deleted.

115 changes: 0 additions & 115 deletions make/generic.mk

This file was deleted.

27 changes: 27 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# CMakeLists.txt

# CMake setup
cmake_minimum_required (VERSION 3.8)

# Set a default build type if none was specified
set(default_build_type "RelWithDebInfo")

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

# Project initialisation
project("datalog-cpp")

# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)

# types_test target
add_executable(types_test ../tests/types_test.cpp)
target_include_directories(types_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions(types_test PUBLIC UNIX)
Loading