Skip to content

Commit

Permalink
fix: Julia packaging issues (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
lan496 committed Dec 4, 2023
2 parents 163f143 + f713aee commit 82c2a22
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ option(SPGLIB_WARNINGS "Spglib: Enable warning messages" ON)
mark_as_advanced(SPGLIB_WITH_WARNINGS)
option(SPGLIB_DEBUG "Spglib: Build in debug mode" ${_Spglib_default_debug})
mark_as_advanced(SPGLIB_DEBUG)
option(SPGLIB_COMPILATION_WARNING "Spglib: Enable compilation warnings" OFF)
mark_as_advanced(SPGLIB_COMPILATION_WARNING)

#[==============================================================================================[
# Project configuration #
Expand Down
4 changes: 4 additions & 0 deletions cmake/CMakePresets-CI.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "RelWithDebInfo"
},
"SPGLIB_COMPILATION_WARNING": {
"type": "BOOL",
"value": true
}
},
"errors": {
Expand Down
2 changes: 1 addition & 1 deletion cmake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ e.g. `-DSPGLIB_WITH_Fortran=ON`.
| **SPGLIB_WITH_Fortran** | OFF | Build Fortran API |
| **SPGLIB_WITH_Python** | OFF | Build Python API |
| **SPGLIB_WITH_TESTS** | ON | Include basic tests |
| **SPGLIB_USE_OMP** | OFF | Use OpenMPI |
| **SPGLIB_USE_OMP** | OFF | Use OpenMP |
| **SPGLIB_USE_SANITIZER** | "" | Specify a sanitizer to compile with<br/> e.g. `address` |
| CMAKE_INSTALL_PREFIX | OS specific<br/>(e.g. `/usr/local`) | Location where to install built project |
| BUILD_SHARED_LIBS | ON | Whether to build shared or statically linked libraries<br/>(Currently unsupported) |
Expand Down
16 changes: 9 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
configure_file(version.h.in version.h)

# Add compiler warnings
if (MSVC)
target_compile_options(Spglib_symspg PRIVATE /W4)
else()
# TODO: C23: Disabled -Wpedantic because of warning spam
# Add it back when C23 standard is widespread and revert this [Temp][C23] commit
target_compile_options(Spglib_symspg PRIVATE -Wall -Wextra)
endif()
if (SPGLIB_COMPILATION_WARNING)
if (MSVC)
target_compile_options(Spglib_symspg PRIVATE /W4)
else()
# TODO: C23: Disabled -Wpedantic because of warning spam
# Add it back when C23 standard is widespread and revert this [Temp][C23] commit
target_compile_options(Spglib_symspg PRIVATE -Wall -Wextra)
endif()
endif ()

# Configure main target
target_sources(Spglib_symspg PRIVATE
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
enable_language(CXX)
include(GoogleTest)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
Expand Down

0 comments on commit 82c2a22

Please sign in to comment.