Skip to content

A lot of error in clang-16 using cmake #38

@Charonxin

Description

@Charonxin
In file included from /home/charon/pscm/src/Evaluator.cpp:7:
/home/charon/pscm/include/pscm/Logger.h:6:27: error: ‘fmt’ has not been declared
    6 |       logger_->log(level, fmt::format(format_, ##__VA_ARGS__));
       \
      |                           ^~~
/home/charon/pscm/include/pscm/Logger.h:11:34: note: in expansion of macro ‘PSCM_LOGGER_LOG’
   11 | #define PSCM_ERROR(format_, ...) PSCM_LOGGER_LOG(logger_, pscm::logger::Logger::Level::ERROR_, format_, ##__VA_ARGS__)
      |                                  ^~~~~~~~~~~~~~~
/home/charon/pscm/src/Evaluator.cpp:2427:5: note: in expansion of macro ‘PSCM_ERROR’
 2427 |     PSCM_ERROR("load file {} error", filename);
      |     ^~~~~~~~~~
/home/charon/pscm/src/Evaluator.cpp: In function ‘pscm::Cell pscm::is_exact(pscm::Cell)’:
/home/charon/pscm/include/pscm/Logger.h:5:34: warning: control reaches end of non-void function [-Wreturn-type]
    5 |     if (logger_->is_level_enabled(level)) {
       \
      |                                  ^
/home/charon/pscm/include/pscm/Logger.h:11:34: note: in expansion of macro ‘PSCM_LOGGER_LOG’
   11 | #define PSCM_ERROR(format_, ...) PSCM_LOGGER_LOG(logger_, pscm::logger::Logger::Level::ERROR_, format_, ##__VA_ARGS__)
      |                                  ^~~~~~~~~~~~~~~
/home/charon/pscm/include/pscm/common_def.h:10:3: note: in expansion of macro ‘PSCM_ERROR’
   10 |   PSCM_ERROR("Exception occurred here: {}", msg);
       \
      |   ^~~~~~~~~~
/home/charon/pscm/src/Evaluator.cpp:815:3: note: in expansion of macro ‘PSCM_THROW_EXCEPTION’
  815 |   PSCM_THROW_EXCEPTION("Wrong type argument in position 1: " + x.to_string());
      |   ^~~~~~~~~~~~~~~~~~~~
/home/charon/pscm/src/Evaluator.cpp: In function ‘pscm::Cell pscm::is_inexact(pscm::Cell)’:
/home/charon/pscm/include/pscm/Logger.h:5:34: warning: control reaches end of non-void function [-Wreturn-type]
    5 |     if (logger_->is_level_enabled(level)) {
       \
      |                                  ^
/home/charon/pscm/include/pscm/Logger.h:11:34: note: in expansion of macro ‘PSCM_LOGGER_LOG’
   11 | #define PSCM_ERROR(format_, ...) PSCM_LOGGER_LOG(logger_, pscm::logger::Logger::Level::ERROR_, format_, ##__VA_ARGS__)
      |                                  ^~~~~~~~~~~~~~~
/home/charon/pscm/include/pscm/common_def.h:10:3: note: in expansion of macro ‘PSCM_ERROR’
   10 |   PSCM_ERROR("Exception occurred here: {}", msg);
       \
      |   ^~~~~~~~~~
/home/charon/pscm/src/Evaluator.cpp:828:3: note: in expansion of macro ‘PSCM_THROW_EXCEPTION’
  828 |   PSCM_THROW_EXCEPTION("Wrong type argument in position 1: " + x.to_string());
      |   ^~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.

run command:

CXX=clang++-16 CC=clang-16 cmake -B build/ -DCMAKE_BUILD_TYPE=Release -G Ninja -DUSE_CCACHE=ON
cmake --build build/ --config Release -j --verbose

firstly i modified some CMakeLists.txt files, from FILE_SET cxx_modules TYPE CXX_MODULES FILES to FILE_SET cxx_modules TYPE HEADERS FILES.

because i face error:

CMake Error at tool/pscm-build/src/CMakeLists.txt:8 (target_sources):
  target_sources File set TYPE may only be "HEADERS"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions