Commit 1750f8ff authored by aarograh's avatar aarograh Committed by Herring, Nicholas
Browse files

Add ability to set package-specific compiler flags from commandline

Squash branch 'add_package_compiler_flags' into 'master'

* Add ability to set package-specific compiler flags from commandline



**Developer Checklist:**
- [x] Have you done a self-review after creating the merge request?
- [x] Have you filled in the Merge Request information (title, description) thoroughly?
- [x] Have you updated the relevant tickets (if this MR is linked to any VERA-dev tickets)?
- [x] Have you addressed all suggested feedback and commented on it to let the reviewer know? (Do not resolve discussions that the reviewer started)

**Reviewer Checklist:**
- [ ] Have you confirmed all discussions were adequately addressed and resolved them all?
- [ ] Does it conform to formatting guidelines?
- [ ] Are there adequate and clear comments?
- [ ] Is the design clean and sensible?
- [ ] Are the changes optimal/efficient?
- [ ] Were sufficient DBC checks added?
- [ ] Are there unit tests? (if necessary)
- [ ] Is the MR description clear, including a link to the VERA-Dev issue if appropriate?

**PSM Checklist**
- [ ] Have you confirmed that all discussions were addressed, or that follow-on issues have been created for them?
- [ ] Have you confirmed sufficient testing was conducted?
- [ ] Does this impact other repositories?
- [ ] Does the MR have an adequate description?
- [ ] If the MR has multiple commits, did you set the MR to squash merge?

See merge request https://code.ornl.gov/futility/Futility/-/merge_requests/405
parent 87d08e25
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -503,6 +503,17 @@ FOREACH(flag ${Fortran_FLAGS_RELWITHDEBINFO})
    ENDIF()
ENDFOREACH()

# Append user-defined, package-specific flags to compiler flags
IF(DEFINED ${PACKAGE_NAME}_EXTRA_C_FLAGS)
    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${PACKAGE_NAME}_EXTRA_C_FLAGS}")
ENDIF()
IF(DEFINED ${PACKAGE_NAME}_EXTRA_CXX_FLAGS)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${PACKAGE_NAME}_EXTRA_CXX_FLAGS}")
ENDIF()
IF(DEFINED ${PACKAGE_NAME}_EXTRA_Fortran_FLAGS)
    SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${${PACKAGE_NAME}_EXTRA_Fortran_FLAGS}")
ENDIF()

# Clear local variables
UNSET(CONFIG_TYPES)
UNSET(CONFIG_EXIST)