Git Product home page Git Product logo

Comments (8)

martinjrobins avatar martinjrobins commented on September 24, 2024

have a look at how I did the openmp compile and link flags using target_compile_options and target_link_libraries:

# OpenMP as an optional component for tests
option(Template_USE_OPENMP "Use OpenMP for shared memory parallism" OFF)
if (Template_USE_OPENMP)
    find_package(OpenMP REQUIRED)
    target_compile_options(mytest PRIVATE "${OpenMP_CXX_FLAGS}")
    target_link_libraries(mytest PRIVATE "${OpenMP_EXE_LINKER_FLAGS}")
endif()

You will also need to filter out only the clang compiler as well
If you need these flags for both the library and test executables, best way is to add them to mylib as PUBLIC, then they will automatically be transferred to mytest

from template-project-cpp.

fcooper8472 avatar fcooper8472 commented on September 24, 2024

I have an implementation ready to go, just want your opinion @martinjrobins:

If someone runs cmake -DTemplate_MEMCHECK=ON and they are using gcc rather than clang, would you prefer a CMake WARNING or a CMake FATAL_ERROR?

I think if the user specifically requests functionality it's OK to make it a FATAL_ERROR?

from template-project-cpp.

martinjrobins avatar martinjrobins commented on September 24, 2024

I agree, make it a FATAL_ERROR. If I request a feature and it can't be satisfied, that is an error.

from template-project-cpp.

fcooper8472 avatar fcooper8472 commented on September 24, 2024

Happy with that changeset @martinjrobins ?

from template-project-cpp.

martinjrobins avatar martinjrobins commented on September 24, 2024

looks good. We might also want to change the way that the coverage option is handled so that it is consistent with the memcheck

from template-project-cpp.

fcooper8472 avatar fcooper8472 commented on September 24, 2024

Do we just want coverage on GCC, or Clang too?

from template-project-cpp.

martinjrobins avatar martinjrobins commented on September 24, 2024

from template-project-cpp.

fcooper8472 avatar fcooper8472 commented on September 24, 2024

OK - I'll close this issue and open a new one for sorting out coverage.

from template-project-cpp.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.