Skip to content

Commit

Permalink
Convert to CMake and GTest
Browse files Browse the repository at this point in the history
  • Loading branch information
MattStephanson committed Jun 26, 2022
1 parent 5092153 commit ce26998
Show file tree
Hide file tree
Showing 12 changed files with 982 additions and 1,510 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vs/
.vscode/
/build/
/out/
20 changes: 20 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cmake_minimum_required (VERSION 3.13)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

project ("mdspan")
add_library(mdspan INTERFACE)
target_include_directories (mdspan INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})

if(MSVC)
target_compile_options(mdspan INTERFACE /W4 /WX)
else()
target_compile_options(mdspan INTERFACE -Wall -Wextra -Wpedantic -Werror)
endif()

set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

enable_testing()
include(GoogleTest)
add_subdirectory(tests)
26 changes: 26 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"configurations": [
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ]
},
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
}
]
}
560 changes: 190 additions & 370 deletions mdspan.h

Large diffs are not rendered by default.

41 changes: 0 additions & 41 deletions mdspan.sln

This file was deleted.

151 changes: 0 additions & 151 deletions mdspan.vcxproj

This file was deleted.

22 changes: 0 additions & 22 deletions mdspan.vcxproj.filters

This file was deleted.

Loading

0 comments on commit ce26998

Please sign in to comment.