Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,18 @@ endif()

option(ENABLE_CGNS "Enable the CGNS reader: requires c++14 extensions" OFF)
message(STATUS "ENABLE_CGNS: ${ENABLE_CGNS}")
if(NOT ENABLE_CGNS)
option(ENABLE_OMEGA_H "Enable the Omega_h interface" OFF)
set(PUMI_USE_OMEGA_H_VERSION "10.0.0" CACHE STRING "Specify the Omega_h version PUMI should use")
message(STATUS "ENABLE_OMEGA_H: ${ENABLE_OMEGA_H}")
if(NOT ENABLE_CGNS AND NOT ENABLE_OMEGA_H)
message(STATUS "enabling cxx11")
bob_set_cxx_standard(11)
else()
elseif(ENABLE_CGNS)
message(STATUS "enabling cxx14")
bob_set_cxx_standard(14)
elseif(ENABLE_OMEGA_H)
message(STATUS "enabling cxx17")
bob_set_cxx_standard(17)
endif()

# Set some default compiler flags that should always be used
Expand Down Expand Up @@ -114,9 +121,6 @@ option(ENABLE_SIMMETRIX "Build with Simmetrix support" OFF)
message(STATUS "ENABLE_SIMMETRIX: ${ENABLE_SIMMETRIX}")
option(ENABLE_CAPSTONE "Build with Capstone support" OFF)
message(STATUS "ENABLE_CAPSTONE: ${ENABLE_CAPSTONE}")
option(ENABLE_OMEGA_H "Enable the Omega_h interface" OFF)
option(PUMI_USE_OMEGA_H_VERSION "Specify the Omega_h version PUMI should use" 10.0.0)
message(STATUS "ENABLE_OMEGA_H: ${ENABLE_OMEGA_H}")

if(ENABLE_SIMMETRIX)
add_definitions(-DHAVE_SIMMETRIX)
Expand Down Expand Up @@ -146,6 +150,8 @@ if(ENABLE_CAPSTONE)
endif()

if(ENABLE_OMEGA_H)
bob_cxx17_flags()
bob_set_cxx_standard(17)
# find the omega_h library
set(SCOREC_USE_Omega_h_DEFAULT ${ENABLE_OMEGA_H})
set(Omega_h_REQUIRED_VERSION ${PUMI_USE_OMEGA_H_VERSION})
Expand Down
11 changes: 11 additions & 0 deletions cmake/bob.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ function(bob_cxx14_flags)
set(CMAKE_CXX_FLAGS "${FLAGS}" PARENT_SCOPE)
endfunction(bob_cxx14_flags)

function(bob_cxx17_flags)
set(FLAGS "${CMAKE_CXX_FLAGS}")
set(FLAGS "${FLAGS} -Wall -Wextra -Wpedantic -Werror -Wno-extra-semi -Werror=unused-parameter -Wno-error=deprecated-declarations")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if (${PROJECT_NAME}_CXX_WARNINGS)
set(FLAGS "${FLAGS} -Wno-c++98-compat-pedantic -Wno-c++98-compat")
endif()
endif()
set(CMAKE_CXX_FLAGS "${FLAGS}" PARENT_SCOPE)
endfunction(bob_cxx17_flags)

function(bob_end_cxx_flags)
set(${PROJECT_NAME}_CXX_FLAGS "" CACHE STRING "Override all C++ compiler flags")
set(${PROJECT_NAME}_EXTRA_CXX_FLAGS "" CACHE STRING "Extra C++ compiler flags")
Expand Down
5 changes: 0 additions & 5 deletions omega_h/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ set(HEADERS

# Add the apf_omega_h library
add_library(apf_omega_h ${SOURCES})
if(ENABLE_CGNS)
target_compile_options(apf_omega_h PUBLIC "-std=c++14")
else()
target_compile_options(apf_omega_h PUBLIC "-std=c++11")
endif()

# Include directories
target_include_directories(apf_omega_h INTERFACE
Expand Down