Initial commit
This commit is contained in:
39
CMakeLists.txt
Normal file
39
CMakeLists.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(
|
||||
project-name
|
||||
VERSION 0.0.0
|
||||
DESCRIPTION ""
|
||||
HOMEPAGE_URL ""
|
||||
LANGUAGES C CXX)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
set(DEFAULT_BUILD_TYPE "Release")
|
||||
|
||||
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()
|
||||
|
||||
add_compile_options(-Werror=switch-enum -Wswitch-enum -Wunused-variable -fPIC
|
||||
-fdata-sections -ffunction-sections)
|
||||
|
||||
add_subdirectory(third_party)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
|
||||
|
||||
include(CTest)
|
||||
include(doctest)
|
||||
|
||||
add_executable(bench src/bench.cpp)
|
||||
target_link_libraries(bench PRIVATE nanobench)
|
||||
|
||||
add_executable(mytest src/test.cpp)
|
||||
target_link_libraries(mytest PRIVATE doctest)
|
||||
doctest_discover_tests(mytest)
|
||||
Reference in New Issue
Block a user