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

MinGW support #49

Open
Trass3r opened this issue Jul 28, 2020 · 3 comments
Open

MinGW support #49

Trass3r opened this issue Jul 28, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@Trass3r
Copy link
Contributor

Trass3r commented Jul 28, 2020

I changed this to build with MinGW:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 71f708f..56223a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,4 +22,4 @@ set(SRC
 )
 add_executable(ClangBuildAnalyzer "${SRC}")
 target_compile_features(ClangBuildAnalyzer PRIVATE cxx_std_17)
-target_link_libraries(ClangBuildAnalyzer -lrt -lpthread)
+target_link_libraries(ClangBuildAnalyzer -lpthread)
diff --git a/src/main.cpp b/src/main.cpp
index 3ef1fc1..68e46d6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -96,7 +96,7 @@ static int RunStart(int argc, const char* argv[])
     return 0;
 }
 
-#ifdef _MSC_VER
+#ifdef _WIN32
 static time_t FiletimeToTime(const FILETIME& ft)
 {
     ULARGE_INTEGER ull;
@@ -128,7 +128,7 @@ struct JsonFileFinder
         if (!cf_get_file_time(f->path, &mtime))
             return;
         time_t fileModTime;
-#ifdef _MSC_VER
+#ifdef _WIN32
         fileModTime = FiletimeToTime(mtime.time);
 #else
         fileModTime = mtime.time;
@aras-p
Copy link
Owner

aras-p commented Oct 3, 2020

-lrt was added to the makefile to make it work on some Linux distribution, so I'd rather not remove that...

@aras-p aras-p added the enhancement New feature or request label Oct 3, 2020
@Trass3r
Copy link
Contributor Author

Trass3r commented Oct 3, 2020

@aras-p
Copy link
Owner

aras-p commented Oct 3, 2020

I guess you could use https://cmake.org/cmake/help/latest/module/CheckLinkerFlag.html.

Maybe, but I know nothing about either of: CMake, Linux or MinGW :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants