Skip to content

Commit

Permalink
Alternative: Prevent superfluous warnings from ranlib about libcellml…
Browse files Browse the repository at this point in the history
….a having no symbols on macOS (closes #532).
  • Loading branch information
agarny authored Jan 30, 2020
2 parents d0e6057 + f676cd7 commit c2596df
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ if(DEFINED BUILD_SHARED)
endif()
unset(BUILD_SHARED CACHE)

# ENABLE_DEBUG_FUNCTIONS ==> LIBCELLML_ENABLE_DEBUG_FUNCTIONS
set(_PARAM_ANNOTATION "Enable the debug functions in debug.(cpp|h).")
set(LIBCELLML_ENABLE_DEBUG_FUNCTIONS OFF CACHE BOOL ${_PARAM_ANNOTATION})
if(DEFINED ENABLE_DEBUG_FUNCTIONS)
set(LIBCELLML_ENABLE_DEBUG_FUNCTIONS ${ENABLE_DEBUG_FUNCTIONS} CACHE BOOL ${_PARAM_ANNOTATION} FORCE)
endif()
unset(ENABLE_DEBUG_FUNCTIONS CACHE)
mark_as_advanced(LIBCELLML_ENABLE_DEBUG_FUNCTIONS)

# Uninstall target
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.in.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
Expand Down
7 changes: 5 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ configure_file(
set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/component.cpp
${CMAKE_CURRENT_SOURCE_DIR}/componententity.cpp
${CMAKE_CURRENT_SOURCE_DIR}/debug.cpp
${CMAKE_CURRENT_SOURCE_DIR}/entity.cpp
${CMAKE_CURRENT_SOURCE_DIR}/error.cpp
${CMAKE_CURRENT_SOURCE_DIR}/generator.cpp
Expand Down Expand Up @@ -107,7 +106,6 @@ set(MODULE_HEADER_FILES
)

set(GIT_HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/debug.h
${CMAKE_CURRENT_SOURCE_DIR}/internaltypes.h
${CMAKE_CURRENT_SOURCE_DIR}/namespaces.h
${CMAKE_CURRENT_SOURCE_DIR}/utilities.h
Expand All @@ -123,6 +121,11 @@ set(HEADER_FILES
${MATHML_CONFIG_H}
)

if (LIBCELLML_ENABLE_DEBUG_FUNCTIONS)
list(APPEND SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/debug.cpp)
list(APPEND HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/debug.h)
endif()

# Only does anything if configuration target is Visual Studio.
group_source_to_dir_structure(
${SOURCE_FILES}
Expand Down
7 changes: 1 addition & 6 deletions src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifdef ENABLE_HANDY_DEBUGGING_FUNCTIONS

# include "debug.h"
#include "debug.h"

namespace libcellml {

Expand Down Expand Up @@ -48,5 +45,3 @@ void printEquivalenceMap(const EquivalenceMap &map)
}

} // namespace libcellml

#endif /* ENABLE_HANDY_DEBUGGING_FUNCTIONS */

0 comments on commit c2596df

Please sign in to comment.