Comments (8)
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.
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.
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.
Happy with that changeset @martinjrobins ?
from template-project-cpp.
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.
Do we just want coverage on GCC, or Clang too?
from template-project-cpp.
from template-project-cpp.
OK - I'll close this issue and open a new one for sorting out coverage.
from template-project-cpp.
Related Issues (19)
- Libraries, dependencies & integrations HOT 7
- cmake on travis macosx cannot find openmp HOT 1
- Rework CMake coverage for consistency HOT 2
- Travis not finding the correct compiler HOT 2
- llvm leaksanitizer fatal error HOT 2
- codecov including catch.h HOT 1
- Header file extension names HOT 1
- Add Eigen support? HOT 1
- Abseil support? HOT 2
- Branch for additional libraries HOT 1
- Docker Images to build C/C++ HOT 1
- Project to potentially base this off HOT 2
- documentation HOT 2
- Update copyright info in files HOT 4
- Correct appveyor badge HOT 1
- Travis configuration HOT 1
- Codecov testing too many files? HOT 3
- exception nothrow warning HOT 21
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from template-project-cpp.