Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative: Prevent superfluous warnings from ranlib about libcellml.a having no symbols on macOS #536

Merged
merged 3 commits into from
Jan 30, 2020
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
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 */