diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9bd9c9e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16) +project(intelhex VERSION 1.0.0 LANGUAGES CXX) + +aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src SUB_SOURCES) + +set(SOURCE + ${SOURCE} + ${SUB_SOURCES} +) + +FILE(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h*) +FILE(GLOB PRIVATE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h*) + +add_library(${PROJECT_NAME} ${SOURCE} ${HEADERS} ${PRIVATE_HEADERS}) + +target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/include/intelhex.h b/include/intelhex.h index 428a701..3251939 100644 --- a/include/intelhex.h +++ b/include/intelhex.h @@ -10,8 +10,6 @@ #include #include -#include - namespace intelhex { diff --git a/src/intelhex.cc b/src/intelhex.cc index e7d01cb..74f3907 100644 --- a/src/intelhex.cc +++ b/src/intelhex.cc @@ -3,13 +3,11 @@ Copyright 2002 Brandon Fosdick (BSD License) */ -#include - -#include -#include -#include #include "intelhex.h" +#include +#include + namespace intelhex { @@ -350,7 +348,7 @@ namespace intelhex while( (s.get() == ':') && s.good() ) { - getline(s, line); // Read the whole line + std::getline(s, line); // Read the whole line if( line.size() <= 10 ) // Ignore truncated lines break; buffer.clear();