Closed Simplxss closed 1 year ago
CLR will enable only when complier is MSVC.
There is one property to enable it.
set_target_properties(mdflibrary PROPERTIES COMMON_LANGUAGE_RUNTIME "")
When built by gcc or other compilers, only pure C functions will be exported.
All exported functions are in MdfExport.h/cpp
.
Moreover, I have tested building in windows and ubuntu(wsl), it wsorks well.(except install)
I don't know how to change the path, the true path is include/mdflibrary/MdfExport.h
.
Why cmake append mdflibrary/
in front of it?
CMake Error at mdflibrary/cmake_install.cmake:65 (file):
file INSTALL cannot find
"/home/runner/work/mdflib/mdflib/mdflibrary/include/mdflibrary/MdfExport.h":
No such file or directory.
Building in Linux and Windows is fixed, macos need replace the functions in mdflib\src\platform.h/cpp to fix. Do you have time to fix it?
The XCode C compiler (XSI vs GNU) need some ifdefs. I don't have a working MacOS environment yet. Will take some days.
It's not possible to build the mdfview(er) or mdf_test executable. Using CLion editor.
FYI Some of the CMAKE_TOOLCHAIN_FILE paths are fixed, not using the VCPKG_ROOT environment varaible. I patched them temporary.
I have added CMakeUserPresets.json to .gitignore, but it didn't take effect... You should config it according to your own environment.
The gitignore trouble is that the *user.json already is in the repository so you need to manually delete it in the repository.
Can you provide your cmake version, visual studio verison. And did you use ninja as generator? In addition, cmake build command and full log.
Tried with Rider (C#) editor. It freaks out as it uses the vcproj/sln not cmake solution. Moving/renaming directories causing problems. Gussing that VS studio have the same problem with the solution file.
Another new feature is that the mdf_test do build with Ninja but when running no test are found. Guessing it's just some cmake "enable test" magic missing.
Can you try to build mdflibrary with generator "Visual Studio 17 2022", the config defined in CMakeUserPresets.json.(remember to change the vcpkg directory)
All C++ projects uses CMake solution and CLion as editor in Windows/Linux/MacOs. Well the last one is in progress. CMake 3.26.4 VS2022 Community 17.0 (window). GUI through WxWidgets.
All C++/CLI and C# applications uses Visual Studio (Windows Only) or JetBrains Rider (All OS) and SLN solution files (not cmake). VS2022 as above. GUI through Avalonia and .NET Core. The C++/CLI interfaces are not for new designs as it doesn't work well with .NET core and Linux. Instead is the gRPC used.
Can you try to build with config msvc-multi-vcpkg? I have tested in CLion and it works well
I have tested with just adding the CMAKE_TOOLCHAIN_FILE and with several modifications, almost everything works but the following doesn't work or is a no go.
I fixed some minor problem with unit test (found no tests problem)
I have tried but the .NET stuff are not compiling. Can we just drop the .NET and C--/CLI out of the CMake project ?
VCPKG should be an option to install packages now. In addition, build on windows will be disabled because MSVC 19.35.32217.1 does not support condition_variable in clr
Another question. The current filepath uses ANSI coding. It will cause error when containing not ASCII words. Is it okey to change it to utf8 coding?
It's OK to change it to UTF8 coding. Mdflib should not be compiled with /clr option?
Mdflib won't be compiled with /clr option, but Mdflibrary will. Maybe I can disable building shared library in workflow? I will try it.
Notice that presets that don't use vcpkg should be added.
Currently in progress, don't maege it! Suggestions welcome.
29 #30