diff --git a/utils/ci/conan/recipe/FMILibrary/all/conanfile.py b/utils/ci/conan/recipe/FMILibrary/all/conanfile.py index a0466b5cb431a3c809d3985921f1c11dd6e11307..f043ebccae518c6612fbddca590a90221550d566 100644 --- a/utils/ci/conan/recipe/FMILibrary/all/conanfile.py +++ b/utils/ci/conan/recipe/FMILibrary/all/conanfile.py @@ -56,7 +56,7 @@ class FmiConan(ConanFile): def build(self): if self.settings.os == "Windows": - cmake = CMake(self, generator="MSYS Makefiles") + cmake = CMake(self) else: cmake = CMake(self) cmake.configure(source_folder=self.name, diff --git a/utils/ci/conan/recipe/FMILibrary/all/patches/fmi-library-2.0.3-fixes.patch b/utils/ci/conan/recipe/FMILibrary/all/patches/fmi-library-2.0.3-fixes.patch index 963a449c067ff31c84751af787016b569f77734a..e9839c763f50f70f02d63c6aa34320333a1640ac 100644 --- a/utils/ci/conan/recipe/FMILibrary/all/patches/fmi-library-2.0.3-fixes.patch +++ b/utils/ci/conan/recipe/FMILibrary/all/patches/fmi-library-2.0.3-fixes.patch @@ -1,66 +1,66 @@ -diff --git a/src/Import/src/FMI1/fmi1_import_capi.c b/src/Import/src/FMI1/fmi1_import_capi.c -index 842c998..eeff2b5 100644 ---- a/src/Import/src/FMI1/fmi1_import_capi.c -+++ b/src/Import/src/FMI1/fmi1_import_capi.c -@@ -67,18 +67,8 @@ jm_status_enu_t fmi1_import_create_dllfmu(fmi1_import_t* fmu, fmi1_callback_func - return jm_status_error; - } - -- if(jm_portability_set_current_working_directory(dllDirPath) != jm_status_success) { -- jm_log_fatal(fmu->callbacks, module, "Could not change to the DLL directory %s", dllDirPath); -- if(ENOENT == errno) -- jm_log_fatal(fmu->callbacks, module, "The FMU contains no binary for this platform."); -- else -- jm_log_fatal(fmu->callbacks, module, "System error: %s", strerror(errno)); -- } -- else { - /* Allocate memory for the C-API struct */ - fmu -> capi = fmi1_capi_create_dllfmu(fmu->callbacks, dllFileName, modelIdentifier, callBackFunctions, standard); -- } -- - - /* Load the DLL handle */ - if (fmu -> capi) { -diff --git a/src/Import/src/FMI2/fmi2_import_capi.c b/src/Import/src/FMI2/fmi2_import_capi.c -index e794775..ffca14d 100644 ---- a/src/Import/src/FMI2/fmi2_import_capi.c -+++ b/src/Import/src/FMI2/fmi2_import_capi.c -@@ -88,18 +88,8 @@ jm_status_enu_t fmi2_import_create_dllfmu(fmi2_import_t* fmu, fmi2_fmu_kind_enu_ - callBackFunctions = &defaultCallbacks; - } - -- if(jm_portability_set_current_working_directory(dllDirPath) != jm_status_success) { -- jm_log_fatal(fmu->callbacks, module, "Could not change to the DLL directory %s", dllDirPath); -- if(ENOENT == errno) -- jm_log_fatal(fmu->callbacks, module, "The FMU contains no binary for this platform."); -- else -- jm_log_fatal(fmu->callbacks, module, "System error: %s", strerror(errno)); -- } -- else { - /* Allocate memory for the C-API struct */ - fmu -> capi = fmi2_capi_create_dllfmu(fmu->callbacks, dllFileName, modelIdentifier, callBackFunctions, fmuKind); -- } -- - - /* Load the DLL handle */ - if (fmu -> capi) { -diff --git a/src/Util/include/JM/jm_portability.h b/src/Util/include/JM/jm_portability.h -index 82e472a..605dff9 100644 ---- a/src/Util/include/JM/jm_portability.h -+++ b/src/Util/include/JM/jm_portability.h -@@ -65,6 +65,7 @@ jm_status_enu_t jm_portability_get_current_working_directory(char* buffer, size_ - jm_status_enu_t jm_portability_set_current_working_directory(const char* cwd); - - /** \brief Get system-wide temporary directory */ -+FMILIB_EXPORT - const char* jm_get_system_temp_dir(); - - /** -@@ -118,6 +119,7 @@ jm_status_enu_t jm_mkdir(jm_callbacks* cb, const char* dir); - /** - \brief Remove directory and all it contents. - */ -+FMILIB_EXPORT - jm_status_enu_t jm_rmdir(jm_callbacks* cb, const char* dir); - - /** +diff --git a/src/Import/src/FMI1/fmi1_import_capi.c b/src/Import/src/FMI1/fmi1_import_capi.c +index 842c998..eeff2b5 100644 +--- a/src/Import/src/FMI1/fmi1_import_capi.c ++++ b/src/Import/src/FMI1/fmi1_import_capi.c +@@ -67,18 +67,8 @@ jm_status_enu_t fmi1_import_create_dllfmu(fmi1_import_t* fmu, fmi1_callback_func + return jm_status_error; + } + +- if(jm_portability_set_current_working_directory(dllDirPath) != jm_status_success) { +- jm_log_fatal(fmu->callbacks, module, "Could not change to the DLL directory %s", dllDirPath); +- if(ENOENT == errno) +- jm_log_fatal(fmu->callbacks, module, "The FMU contains no binary for this platform."); +- else +- jm_log_fatal(fmu->callbacks, module, "System error: %s", strerror(errno)); +- } +- else { + /* Allocate memory for the C-API struct */ + fmu -> capi = fmi1_capi_create_dllfmu(fmu->callbacks, dllFileName, modelIdentifier, callBackFunctions, standard); +- } +- + + /* Load the DLL handle */ + if (fmu -> capi) { +diff --git a/src/Import/src/FMI2/fmi2_import_capi.c b/src/Import/src/FMI2/fmi2_import_capi.c +index e794775..ffca14d 100644 +--- a/src/Import/src/FMI2/fmi2_import_capi.c ++++ b/src/Import/src/FMI2/fmi2_import_capi.c +@@ -88,18 +88,8 @@ jm_status_enu_t fmi2_import_create_dllfmu(fmi2_import_t* fmu, fmi2_fmu_kind_enu_ + callBackFunctions = &defaultCallbacks; + } + +- if(jm_portability_set_current_working_directory(dllDirPath) != jm_status_success) { +- jm_log_fatal(fmu->callbacks, module, "Could not change to the DLL directory %s", dllDirPath); +- if(ENOENT == errno) +- jm_log_fatal(fmu->callbacks, module, "The FMU contains no binary for this platform."); +- else +- jm_log_fatal(fmu->callbacks, module, "System error: %s", strerror(errno)); +- } +- else { + /* Allocate memory for the C-API struct */ + fmu -> capi = fmi2_capi_create_dllfmu(fmu->callbacks, dllFileName, modelIdentifier, callBackFunctions, fmuKind); +- } +- + + /* Load the DLL handle */ + if (fmu -> capi) { +diff --git a/src/Util/include/JM/jm_portability.h b/src/Util/include/JM/jm_portability.h +index 82e472a..605dff9 100644 +--- a/src/Util/include/JM/jm_portability.h ++++ b/src/Util/include/JM/jm_portability.h +@@ -65,6 +65,7 @@ jm_status_enu_t jm_portability_get_current_working_directory(char* buffer, size_ + jm_status_enu_t jm_portability_set_current_working_directory(const char* cwd); + + /** \brief Get system-wide temporary directory */ ++FMILIB_EXPORT + const char* jm_get_system_temp_dir(); + + /** +@@ -118,6 +119,7 @@ jm_status_enu_t jm_mkdir(jm_callbacks* cb, const char* dir); + /** + \brief Remove directory and all it contents. + */ ++FMILIB_EXPORT + jm_status_enu_t jm_rmdir(jm_callbacks* cb, const char* dir); + + /** diff --git a/utils/ci/conan/recipe/MantleAPI/all/conanfile.py b/utils/ci/conan/recipe/MantleAPI/all/conanfile.py index f2fe2ad2843f1eaf5d967c70d4808003d44c571f..8126ce823435eaf82fa4f3af2636a2e16a29eb9f 100644 --- a/utils/ci/conan/recipe/MantleAPI/all/conanfile.py +++ b/utils/ci/conan/recipe/MantleAPI/all/conanfile.py @@ -39,7 +39,7 @@ class MantleAPIConan(ConanFile): if self.settings.os == "Windows": del self.options.fPIC if not self.options.cmake_generator: - self.options.cmake_generator = self.env.get("CONAN_CMAKE_GENERATOR", "MSYS Makefiles") + self.options.cmake_generator = self.env.get("CONAN_CMAKE_GENERATOR", "Unix Makefiles") else: if not self.options.cmake_generator: self.options.cmake_generator = self.env.get("CONAN_CMAKE_GENERATOR", "Unix Makefiles") diff --git a/utils/ci/conan/recipe/Yase/all/conanfile.py b/utils/ci/conan/recipe/Yase/all/conanfile.py index a423e9e308195568322ec25af8fb4bbd01bff8bd..d37729b1df083b251314fcc036731074e5fc4eb9 100644 --- a/utils/ci/conan/recipe/Yase/all/conanfile.py +++ b/utils/ci/conan/recipe/Yase/all/conanfile.py @@ -51,7 +51,7 @@ class YaseConan(ConanFile): def build(self): if self.settings.os == "Windows": - cmake = CMake(self, generator="MSYS Makefiles") + cmake = CMake(self) cmake.configure(source_folder=self.name, defs={"Yase_BUILD_TESTS":False}) else: cmake = CMake(self) @@ -60,7 +60,7 @@ class YaseConan(ConanFile): def package(self): if self.settings.os == "Windows": - cmake = CMake(self, generator="MSYS Makefiles") + cmake = CMake(self) else: cmake = CMake(self) cmake.install() diff --git a/utils/ci/conan/recipe/open-simulation-interface/all/conanfile.py b/utils/ci/conan/recipe/open-simulation-interface/all/conanfile.py index 03a482e654212232046a116271401539815a1f20..da7da59bc76ba29bcea00a1725e81020938d2879 100644 --- a/utils/ci/conan/recipe/open-simulation-interface/all/conanfile.py +++ b/utils/ci/conan/recipe/open-simulation-interface/all/conanfile.py @@ -47,14 +47,14 @@ class OpenSimulationInterfaceConan(ConanFile): return "build_subfolder" def requirements(self): - if self.settings.os == "Linux": - self.requires("protobuf/3.20.0@") - self.options["protobuf"].shared = True + # if self.settings.os == "Linux": + self.requires("protobuf/3.20.0@") + self.options["protobuf"].shared = True def build_requirements(self): if self.settings.os == "Windows": - self.requires("protobuf/3.20.0@") - self.options["protobuf"].shared = True + # self.requires("protobuf/3.20.0@") + # self.options["protobuf"].shared = True self.tool_requires("protobuf/3.20.0@") self.options["protobuf"].shared = True @@ -69,21 +69,28 @@ class OpenSimulationInterfaceConan(ConanFile): def build(self): if self.settings.os == "Windows": - cmake = CMake(self, generator="MSYS Makefiles") + PROTOBUF_PROTOC_EXECUTABLE = os.path.join(self.deps_cpp_info["protobuf"].bin_paths[0], "protoc") + PROTOBUF_LIBRARY = os.path.join(self.deps_cpp_info["protobuf"].lib_paths[0], "libprotobuf.dll.a") + print("protobuf_protoc_exec: ", PROTOBUF_PROTOC_EXECUTABLE) + print("PROTOBUF_LIBRARY: ", PROTOBUF_LIBRARY) + print("PROTOBUF_INCLUDE_DIR: ", self.deps_cpp_info["protobuf"].include_paths[0]) + cmake = CMake(self, generator="Unix Makefiles") cmake.configure(source_folder=self._repo_source, defs={"CMAKE_BUILD_TYPE":"Release", - "CMAKE_INSTALL_PREFIX":"osi3.5.0"}) + "PROTOBUF_INCLUDE_DIR":self.deps_cpp_info["protobuf"].include_paths[0], + "CMAKE_INSTALL_PREFIX":"osi3.5.0", + "PROTOBUF_LIBRARY":PROTOBUF_LIBRARY}) else: cmake = CMake(self) PROTOBUF_PROTOC_EXECUTABLE = os.path.join(self.deps_cpp_info["protobuf"].bin_paths[0], "protoc") PROTOBUF_LIBRARY = os.path.join(self.deps_cpp_info["protobuf"].lib_paths[0], "libprotobuf.so") cmake.configure(source_folder=self._repo_source, - defs={"CMAKE_GENERATOR_ARG":"Unix Makefiles", - "CMAKE_BUILD_TYPE":"Release", - "CMAKE_INSTALL_PREFIX":"osi3.5.0", - "PROTOBUF_INCLUDE_DIR":self.deps_cpp_info["protobuf"].include_paths[0], - "PROTOBUF_PROTOC_EXECUTABLE":PROTOBUF_PROTOC_EXECUTABLE, - "PROTOBUF_LIBRARY":PROTOBUF_LIBRARY}) + defs={"CMAKE_GENERATOR_ARG":"Unix Makefiles", + "CMAKE_BUILD_TYPE":"Release", + "CMAKE_INSTALL_PREFIX":"osi3.5.0", + "PROTOBUF_INCLUDE_DIR":self.deps_cpp_info["protobuf"].include_paths[0], + "PROTOBUF_PROTOC_EXECUTABLE":PROTOBUF_PROTOC_EXECUTABLE, + "PROTOBUF_LIBRARY":PROTOBUF_LIBRARY}) cmake.build() cmake.install() diff --git a/utils/ci/conan/recipe/openscenario_api/all/conanfile.py b/utils/ci/conan/recipe/openscenario_api/all/conanfile.py index 4a3e53105435dacd090ac71dd398589367e5a311..cb9ba74543f4a2f4d7335897469ad17907455908 100644 --- a/utils/ci/conan/recipe/openscenario_api/all/conanfile.py +++ b/utils/ci/conan/recipe/openscenario_api/all/conanfile.py @@ -49,10 +49,10 @@ class OpenScenarioApiConan(ConanFile): def _patch_sources(self): os.chdir(self.name) - if self.settings.os == "Windows": - os.system('git apply ../patches/v1.3.1.patch') - else: - os.system('git apply ../patches/rpath.patch') + # if self.settings.os == "Windows": + # os.system('git apply ../patches/v1.3.1.patch') + # else: + os.system('git apply ../patches/rpath.patch') def source(self): url, sha256 = self._get_url_sha() @@ -66,8 +66,8 @@ class OpenScenarioApiConan(ConanFile): def build(self): if self.settings.os == "Windows": os.chdir(os.path.join(self._repo_source, "cpp")) - os.system('cmake -Wno-dev --preset="MSYS-shared-release"') - os.system('cmake --build --preset="Build-MSYS-shared-release"') + os.system('cmake -G "Unix Makefiles" -Wno-dev ') + os.system('cmake --build .') else: os.chdir(self._artifact_path) os.system('chmod +x generateLinux.sh') diff --git a/utils/ci/conan/recipe/units/all/conanfile.py b/utils/ci/conan/recipe/units/all/conanfile.py index 5490b982ddce94e6afba62639b2fc8204473b77f..c993dd917ee8edca50921af431cfe0e59303611b 100644 --- a/utils/ci/conan/recipe/units/all/conanfile.py +++ b/utils/ci/conan/recipe/units/all/conanfile.py @@ -39,7 +39,7 @@ class UnitsConan(ConanFile): del self.options.fPIC if not self.options.cmake_generator: self.options.cmake_generator = self.env.get( - "CONAN_CMAKE_GENERATOR", "MSYS Makefiles") + "CONAN_CMAKE_GENERATOR", "Unix Makefiles") else: if not self.options.cmake_generator: self.options.cmake_generator = self.env.get(