changed standards to 18
This commit is contained in:
parent
caf281b927
commit
ea1deb6e3c
|
@ -22,30 +22,54 @@ endif()
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
# Request C 11 standard features
|
# Request C 11 standard features
|
||||||
set(CMAKE_C_STANDARD 17)
|
set(CMAKE_C_STANDARD 18)
|
||||||
set(CMAKE_C_STANDARD_REQUIRED True)
|
set(CMAKE_C_STANDARD_REQUIRED True)
|
||||||
set(CMAKE_C_FLAGS "-Wall -Werror -Wpedantic")
|
set(CMAKE_C_FLAGS "-Wall -Werror -Wpedantic")
|
||||||
|
|
||||||
# SETUP THE CXX flags for .cpp
|
# SETUP THE CXX flags for .cpp
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 18)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
set(CMAKE_CXX_FLAGS "-Wall -Werror -Wpedantic")
|
set(CMAKE_CXX_FLAGS "-Wall -Werror -Wpedantic")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# #######################################
|
# #######################################
|
||||||
# TESTING STUFF
|
# TESTING STUFF
|
||||||
# #######################################
|
# #######################################
|
||||||
|
|
||||||
# find_library()
|
# find_library()
|
||||||
set(CPPUTEST_DIR "./cpputest/include")
|
set(CPPUTEST_INC_DIR "./cpputest/include")
|
||||||
|
set(CPPUTEST_LIB "./cpputest/build/src/CppUTest/libCppUTest.a")
|
||||||
|
|
||||||
|
# include_directories(
|
||||||
|
# ${CPPUTEST_DIR}
|
||||||
|
# ${CPPUTEST_DIR}/CppUTest
|
||||||
|
# ${CPPUTEST_DIR}/CppUTestExt
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
# add_library(CppUTest OBJECT
|
||||||
|
# ${CPPUTEST_LIB}
|
||||||
|
# )
|
||||||
|
|
||||||
if (UNIT_TESTING)
|
if (UNIT_TESTING)
|
||||||
include_directories(
|
|
||||||
${CPPUTEST_DIR}/CppUTest
|
if(DEFINED ENV{CPPUTEST_HOME})
|
||||||
${CPPUTEST_DIR}/CppUTestExt
|
message(STATUS "Using CppUTest home: $ENV{CPPUTEST_HOME}")
|
||||||
)
|
set(CPPUTEST_INCLUDE_DIRS $ENV{CPPUTEST_HOME}/include)
|
||||||
|
set(CPPUTEST_LIBRARIES $ENV{CPPUTEST_HOME}/lib)
|
||||||
|
set(CPPUTEST_LDFLAGS CppUTest CppUTestExt)
|
||||||
|
else()
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_search_module(CPPUTEST REQUIRED cpputest>=3.8)
|
||||||
|
message(STATUS "Found CppUTest version ${CPPUTEST_VERSION}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include_directories(${CPPUTEST_INCLUDE_DIRS} ../src/)
|
||||||
|
link_directories(${CPPUTEST_LIBRARIES})
|
||||||
|
|
||||||
message(STATUS "CPPUTEST_DIR: ${CPPUTEST_DIR}")
|
message(STATUS "CPPUTEST_DIR: ${CPPUTEST_DIR}")
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# #######################################
|
# #######################################
|
||||||
|
|
Loading…
Reference in New Issue