-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7339909
commit a9df87d
Showing
11 changed files
with
652 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
language: cpp | ||
sudo: true | ||
|
||
matrix: | ||
include: | ||
- name: "gcc 8" | ||
env: MATRIX_ENV="CC=gcc-8 CXX=g++-8" | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- libnuma-dev | ||
- g++-8 | ||
- name: "gcc 7" | ||
env: MATRIX_ENV="CC=gcc-7 CXX=g++-7" | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- libnuma-dev | ||
- g++-7 | ||
- name: "gcc 6" | ||
env: MATRIX_ENV="CC=gcc-6 CXX=g++-6" | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- libnuma-dev | ||
- g++-6 | ||
- name: "clang 6" | ||
env: MATRIX_ENV="CC=clang-6.0 CXX=clang++-6.0" | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
- llvm-toolchain-trusty-6.0 | ||
packages: | ||
- libnuma-dev | ||
- libstdc++-8-dev | ||
- clang-6.0 | ||
|
||
env: | ||
global: | ||
- MAKEFLAGS="-j 2" # parallelize compilation process | ||
|
||
before_install: eval "${MATRIX_ENV}" | ||
|
||
script: | ||
- cmake . -DCMAKE_BUILD_TYPE=Debug | ||
- make all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(unstickymem VERSION 1.0 LANGUAGES CXX C) | ||
|
||
include(GNUInstallDirs) | ||
include(CTest) | ||
|
||
set(CMAKE_VERBOSE_MAKEFILE OFF) | ||
|
||
# get list of source files | ||
file(GLOB_RECURSE procmap_src relative ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp" "src/*c") | ||
add_library(procmap SHARED ${procmap_src}) | ||
|
||
set_property(TARGET procmap PROPERTY POSITION_INDEPENDENT_CODE on) | ||
|
||
target_compile_features(procmap PRIVATE cxx_std_14) | ||
|
||
target_compile_options(procmap PRIVATE -g -Wall -pedantic -Wshadow -Wfatal-errors) | ||
|
||
target_include_directories(procmap | ||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
PUBLIC $<INSTALL_INTERFACE:include> | ||
PRIVATE src) | ||
|
||
# 'make install' to the correct locations (provided by GNUInstallDirs) | ||
install(TARGETS procmap | ||
EXPORT procmap_config | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
||
# This makes the project importable from the install directory | ||
# Put config file in per-project dir (name MUST match), can also | ||
# just go into 'cmake' | ||
install(EXPORT procmap_config DESTINATION share/procmap/cmake) | ||
|
||
# uninstall target | ||
if(NOT TARGET uninstall) | ||
configure_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" | ||
IMMEDIATE @ONLY) | ||
add_custom_target(uninstall | ||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) | ||
endif() | ||
|
||
|
||
# tests/examples | ||
add_executable(simple test/simple.cpp) | ||
target_link_libraries(simple procmap) | ||
add_test(simple simple) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") | ||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") | ||
endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") | ||
|
||
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) | ||
string(REGEX REPLACE "\n" ";" files "${files}") | ||
foreach(file ${files}) | ||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}") | ||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") | ||
exec_program( | ||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" | ||
OUTPUT_VARIABLE rm_out | ||
RETURN_VALUE rm_retval | ||
) | ||
if(NOT "${rm_retval}" STREQUAL 0) | ||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") | ||
endif(NOT "${rm_retval}" STREQUAL 0) | ||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") | ||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.") | ||
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") | ||
endforeach(file) |
Oops, something went wrong.