mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Merge pull request #2040 from aprilnovak/cxx_17
Allow control of C++ standard.
This commit is contained in:
commit
996ada5d5b
2 changed files with 4 additions and 7 deletions
|
|
@ -454,11 +454,9 @@ target_compile_options(openmc PRIVATE ${cxxflags})
|
|||
target_include_directories(openmc PRIVATE ${CMAKE_BINARY_DIR}/include)
|
||||
target_link_libraries(openmc libopenmc)
|
||||
|
||||
# Ensure C++14 standard is used. Starting with CMake 3.8, another way this could
|
||||
# be done is using the cxx_std_14 compiler feature.
|
||||
set_target_properties(
|
||||
openmc libopenmc
|
||||
PROPERTIES CXX_STANDARD 14 CXX_EXTENSIONS OFF)
|
||||
# Ensure C++14 standard is used
|
||||
target_compile_features(openmc PUBLIC cxx_std_14)
|
||||
target_compile_features(libopenmc PUBLIC cxx_std_14)
|
||||
|
||||
#===============================================================================
|
||||
# Python package
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ def cpp_driver(request):
|
|||
add_executable(main main.cpp)
|
||||
find_package(OpenMC REQUIRED HINTS {})
|
||||
target_link_libraries(main OpenMC::libopenmc)
|
||||
set_target_properties(main PROPERTIES CXX_STANDARD
|
||||
14 CXX_STANDARD_REQUIRED YES CXX_EXTENSIONS NO)
|
||||
target_compile_features(main PUBLIC cxx_std_14)
|
||||
set(CMAKE_CXX_FLAGS "-pedantic-errors")
|
||||
add_compile_definitions(DAGMC=1)
|
||||
""".format(openmc_dir)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue