Skip to content

Commit

Permalink
Removed warning
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhjp01 committed Feb 7, 2022
1 parent 4e37d73 commit 2f42592
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ option(LIBCOSIM_BUILD_PRIVATE_APIDOC "Build private API documentation (only used
option(LIBCOSIM_STANDALONE_INSTALLATION "Whether to build for a standalone installation (Linux only; sets a relative RPATH)" OFF)
option(LIBCOSIM_USING_CONAN "Whether Conan is used for package management" OFF)
option(LIBCOSIM_WITH_PROXYFMU "Whether or not to build with proxy-fmu integration" OFF)
option(LIBCOSIM_FMI_LOGGING "Enabling FMI logging during simulation" ON)
option(LIBCOSIM_NO_FMI_LOGGING "Disable FMI logging during simulation" OFF)

# ==============================================================================
# Global internal configuration
# ==============================================================================

# Configure logging in the fmi callback function
if(LIBCOSIM_FMI_LOGGING)
add_compile_definitions(LIBCOSIM_FMI_LOGGING=1)
if(LIBCOSIM_NO_FMI_LOGGING)
add_compile_definitions(LIBCOSIM_NO_FMI_LOGGING=1)
endif()

# Our custom CMake scripts go in the cmake/ subdirectory.
Expand Down
6 changes: 3 additions & 3 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class LibcosimConan(ConanFile):
options = {
"shared": [True, False],
"proxyfmu": [True, False],
"fmi_log": [True, False]}
"no_fmi_logging": [True, False]}
default_options = (
"proxyfmu=False",
"shared=True",
"fmi_log=True"
"no_fmi_logging=False"
)

def is_tests_enabled(self):
Expand Down Expand Up @@ -67,7 +67,7 @@ def configure_cmake(self):
cmake.definitions["LIBCOSIM_BUILD_APIDOC"] = "OFF"
cmake.definitions["LIBCOSIM_BUILD_TESTS"] = self.is_tests_enabled()
cmake.definitions["BUILD_SHARED_LIBS"] = self.options.shared
cmake.definitions["LIBCOSIM_FMI_LOGGING"] = self.options.fmi_log
cmake.definitions["LIBCOSIM_NO_FMI_LOGGING"] = self.options.no_fmi_logging
if self.options.proxyfmu:
cmake.definitions["LIBCOSIM_WITH_PROXYFMU"] = "ON"
cmake.configure()
Expand Down
4 changes: 2 additions & 2 deletions src/cosim/fmi/v1/fmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ std::mutex g_logMutex;

void log_message(
fmi1_component_t,
#ifdef LIBCOSIM_FMI_LOGGING
#ifndef LIBCOSIM_NO_FMI_LOGGING
fmi1_string_t instanceName,
fmi1_status_t status,
fmi1_string_t category,
Expand All @@ -199,7 +199,7 @@ void log_message(
#endif
...)
{
#ifdef LIBCOSIM_FMI_LOGGING
#ifndef LIBCOSIM_NO_FMI_LOGGING
std::va_list args;
va_start(args, message);
const auto msgLength = std::vsnprintf(nullptr, 0, message, args);
Expand Down
4 changes: 2 additions & 2 deletions src/cosim/fmi/v2/fmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ std::mutex g_logMutex;

void log_message(
fmi2_component_environment_t,
#ifdef LIBCOSIM_FMI_LOGGING
#ifndef LIBCOSIM_NO_FMI_LOGGING
fmi2_string_t instanceName,
fmi2_status_t status,
fmi2_string_t category,
Expand All @@ -199,7 +199,7 @@ void log_message(
#endif
...)
{
#ifdef LIBCOSIM_FMI_LOGGING
#ifndef LIBCOSIM_NO_FMI_LOGGING
std::va_list args;
va_start(args, message);
const auto msgLength = std::vsnprintf(nullptr, 0, message, args);
Expand Down

0 comments on commit 2f42592

Please sign in to comment.