Skip to content

Commit

Permalink
today()
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Jun 12, 2024
1 parent 0c95001 commit 8535d7f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/dist")
SET(GCC_N_CLANG_BASE_OPTIONS "-Wall -Wextra -Wpedantic -Warray-bounds -mtune=native -fexceptions")
# target_link_options(${PROJECT_NAME} PUBLIC -flto=auto)

SET(MSVC_BASE_OPTIONS "/EHsc /bigobj")
SET(MSVC_BASE_OPTIONS "/Wall /EHsc /bigobj")


#########
Expand All @@ -43,6 +43,12 @@ if(NOT EXISTS "${ANTLR_EXECUTABLE}")
file(DOWNLOAD "https://www.antlr.org/download/antlr-${ANTLR4_TAG}-complete.jar" "${ANTLR_EXECUTABLE}")
endif()

if (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Od /fsanitize=address /Zi")
else ()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox /GL ")
endif ()


if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(ENV{MACOSX_DEPLOYMENT_TARGET} "11.0")
Expand All @@ -52,11 +58,14 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
message("Platform is WINDOWS")
SET(MSVC_EXTRA_OPTIONS "")
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
SET(GCC_N_CLANG_EXTRA_OPTIONS "-fcoroutines -visibility=hidden -g0")
SET(GCC_N_CLANG_EXTRA_OPTIONS "-fcoroutines -fvisibility=hidden -g0")
message("Platform is LINUX")
endif()





IF (CMAKE_C_COMPILER_ID STREQUAL "GNU")

ELSEIF (CMAKE_C_COMPILER_ID MATCHES "Clang")
Expand Down
10 changes: 1 addition & 9 deletions pya2l/extensions/a2lparser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,8 @@ class A2LParser {
//
// TODO: Addressmapper
// auto msg {"[INFO (pya2l.parser)]"};
auto msg{ "" };

std::cerr << "Invalid token: " << token->toString() << std::endl;
#if 0
throw std::runtime_error(
//"Invalid token: " + std::to_string(token->getType()) + " -- line: " + std::to_string(token->getLine()) +
//" column: " + std::to_string(token->column())
"Invalid token: " + token->toString()
);
#endif
}

if (token->getText() == "IF_DATA") {
Expand Down Expand Up @@ -188,7 +180,7 @@ class A2LParser {
std::cerr << kw_tos().m_name << " is missing one or more required parameters: " << std::endl;
// std::cerr << token->toString() << std::endl;

for (auto idx = param_count; idx < std::size(kw_tos().m_parameters); ++idx) {
for (std::size_t idx = param_count; idx < std::size(kw_tos().m_parameters); ++idx) {
auto p = kw_tos().m_parameters[idx];

std::cerr << "\t" << p.get_name() << std::endl;
Expand Down
5 changes: 2 additions & 3 deletions pya2l/extensions/preprocessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Preprocessor {
const std::string AML_TMP = "AML.tmp";
const std::string IFDATA_TMP = "IFDATA.tmp";

Preprocessor(const std::string& loglevel) :
Preprocessor(const std::string& loglevel) : m_loglevel(loglevel),
tmp_a2l(A2L_TMP, true),
tmp_aml(AML_TMP),
tmp_ifdata(IFDATA_TMP, true),
Expand All @@ -84,8 +84,6 @@ class Preprocessor {
m_filenames.a2l = tmp_a2l.abs_path();
m_filenames.aml = tmp_aml.abs_path();
m_filenames.ifdata = tmp_ifdata.abs_path();

auto tw = TokenWriter(tmp_a2l);
}

~Preprocessor() {
Expand Down Expand Up @@ -378,6 +376,7 @@ class Preprocessor {

private:

std::string m_loglevel
TempFile tmp_a2l;
TempFile tmp_aml;
TempFile tmp_ifdata;
Expand Down

0 comments on commit 8535d7f

Please sign in to comment.