lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [01/13] git commit: refs/heads/makefile-rework - Add MSVC /nologo automatically
Date Wed, 15 May 2013 17:24:25 GMT
Updated Branches:
  refs/heads/makefile-rework [created] 07c277014


Add MSVC /nologo automatically


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/ff53edf2
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/ff53edf2
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/ff53edf2

Branch: refs/heads/makefile-rework
Commit: ff53edf2683a559372055e4ed9d99c7eb082121d
Parents: 175f115
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Tue May 14 21:46:48 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Wed May 15 19:13:53 2013 +0200

----------------------------------------------------------------------
 charmonizer/src/Charmonizer/Core/Make.c    |   11 ++++++++++-
 clownfish/compiler/common/charmonizer.main |   12 ++----------
 common/charmonizer.main                    |   14 +++-----------
 3 files changed, 15 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/ff53edf2/charmonizer/src/Charmonizer/Core/Make.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/Make.c b/charmonizer/src/Charmonizer/Core/Make.c
index d57034e..22d4764 100644
--- a/charmonizer/src/Charmonizer/Core/Make.c
+++ b/charmonizer/src/Charmonizer/Core/Make.c
@@ -276,6 +276,9 @@ chaz_MakeFile_add_exe(chaz_MakeFile *makefile, const char *exe,
     if (link_flags) {
         link_flags_string = chaz_CFlags_get_string(link_flags);
     }
+    if (chaz_CC_msvc_version_num()) {
+        chaz_CFlags_append(local_flags, "/nologo");
+    }
     chaz_CFlags_set_link_output(local_flags, exe);
     local_flags_string = chaz_CFlags_get_string(local_flags);
     command = chaz_Util_join(" ", link, sources, link_flags_string,
@@ -304,6 +307,9 @@ chaz_MakeFile_add_compiled_exe(chaz_MakeFile *makefile, const char *exe,
     if (cflags) {
         cflags_string = chaz_CFlags_get_string(cflags);
     }
+    if (chaz_CC_msvc_version_num()) {
+        chaz_CFlags_append(local_flags, "/nologo");
+    }
     chaz_CFlags_set_output_exe(local_flags, exe);
     local_flags_string = chaz_CFlags_get_string(local_flags);
     command = chaz_Util_join(" ", cc, sources, cflags_string,
@@ -335,6 +341,9 @@ chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, chaz_SharedLib *lib,
     if (link_flags) {
         link_flags_string = chaz_CFlags_get_string(link_flags);
     }
+    if (chaz_CC_msvc_version_num()) {
+        chaz_CFlags_append(local_flags, "/nologo");
+    }
     chaz_CFlags_link_shared_library(local_flags);
     chaz_CFlags_set_shared_library_version(local_flags, lib);
     chaz_CFlags_set_link_output(local_flags, filename);
@@ -388,7 +397,7 @@ chaz_MakeFile_write(chaz_MakeFile *makefile) {
         /* Inference rule for .c files. */
         fprintf(out, ".c.obj :\n");
         if (chaz_CC_msvc_version_num()) {
-            fprintf(out, "\t$(CC) $(CFLAGS) /c $< /Fo$@\n\n");
+            fprintf(out, "\t$(CC) /nologo $(CFLAGS) /c $< /Fo$@\n\n");
         }
         else {
             fprintf(out, "\t$(CC) $(CFLAGS) -c $< -o $@\n\n");

http://git-wip-us.apache.org/repos/asf/lucy/blob/ff53edf2/clownfish/compiler/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/clownfish/compiler/common/charmonizer.main b/clownfish/compiler/common/charmonizer.main
index df03a70..fd713f3 100644
--- a/clownfish/compiler/common/charmonizer.main
+++ b/clownfish/compiler/common/charmonizer.main
@@ -70,14 +70,6 @@ S_add_compiler_flags(struct chaz_CLIArgs *args) {
 }
 
 static void
-S_add_common_cflags(chaz_CFlags *cflags) {
-    if (chaz_CC_msvc_version_num()) {
-        chaz_CFlags_append(cflags, "/nologo");
-    }
-    chaz_CFlags_enable_optimization(cflags);
-}
-
-static void
 S_source_file_callback(char *file, void *context) {
     SourceFileContext *sfc = (SourceFileContext*)context;
     size_t file_len = strlen(file);
@@ -161,8 +153,8 @@ S_write_makefile(struct chaz_CLIArgs *args) {
     chaz_MakeFile_add_var(makefile, "CC", chaz_CC_get_cc());
 
     makefile_cflags = chaz_CC_new_cflags();
-    S_add_common_cflags(makefile_cflags);
 
+    chaz_CFlags_enable_optimization(makefile_cflags);
     chaz_CFlags_add_include_dir(makefile_cflags, ".");
     chaz_CFlags_add_include_dir(makefile_cflags, "$(INCLUDE_DIR)");
     chaz_CFlags_add_include_dir(makefile_cflags, "$(SRC_DIR)");
@@ -203,7 +195,7 @@ S_write_makefile(struct chaz_CLIArgs *args) {
     chaz_MakeFile_add_rule(makefile, "all", "$(CFC_EXE)");
 
     lemon_cflags = chaz_CC_new_cflags();
-    S_add_common_cflags(lemon_cflags);
+    chaz_CFlags_enable_optimization(lemon_cflags);
     chaz_MakeFile_add_compiled_exe(makefile, "$(LEMON_EXE)",
                                    "$(LEMON_DIR)" DIR_SEP "lemon.c",
                                    lemon_cflags);

http://git-wip-us.apache.org/repos/asf/lucy/blob/ff53edf2/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/common/charmonizer.main b/common/charmonizer.main
index e8fc434..e595057 100644
--- a/common/charmonizer.main
+++ b/common/charmonizer.main
@@ -101,14 +101,6 @@ S_add_compiler_flags(struct chaz_CLIArgs *args) {
 }
 
 static void
-S_add_common_cflags(chaz_CFlags *cflags) {
-    if (chaz_CC_msvc_version_num()) {
-        chaz_CFlags_append(cflags, "/nologo");
-    }
-    chaz_CFlags_enable_optimization(cflags);
-}
-
-static void
 S_source_file_callback(char *file, void *context) {
     SourceFileContext *sfc = (SourceFileContext*)context;
     const char *json_parser_c = "Lucy" DIR_SEP "Util" DIR_SEP "Json" DIR_SEP
@@ -206,8 +198,8 @@ S_write_makefile(struct chaz_CLIArgs *args) {
     chaz_MakeFile_add_var(makefile, "CC", chaz_CC_get_cc());
 
     makefile_cflags = chaz_CC_new_cflags();
-    S_add_common_cflags(makefile_cflags);
 
+    chaz_CFlags_enable_optimization(makefile_cflags);
     chaz_CFlags_disable_strict_aliasing(makefile_cflags);
     chaz_CFlags_compile_shared_library(makefile_cflags);
     chaz_CFlags_hide_symbols(makefile_cflags);
@@ -290,7 +282,7 @@ S_write_makefile(struct chaz_CLIArgs *args) {
     chaz_MakeFile_add_rule(makefile, "all", lib_filename);
 
     lemon_cflags = chaz_CC_new_cflags();
-    S_add_common_cflags(lemon_cflags);
+    chaz_CFlags_enable_optimization(lemon_cflags);
     chaz_MakeFile_add_compiled_exe(makefile, "$(LEMON_EXE)",
                                    "$(LEMON_DIR)" DIR_SEP "lemon.c",
                                    lemon_cflags);
@@ -341,7 +333,7 @@ S_write_makefile(struct chaz_CLIArgs *args) {
     chaz_CFlags_destroy(link_flags);
 
     test_cflags = chaz_CC_new_cflags();
-    S_add_common_cflags(test_cflags);
+    chaz_CFlags_enable_optimization(test_cflags);
     chaz_CFlags_add_include_dir(test_cflags, ".");
     chaz_CFlags_add_include_dir(test_cflags,
                                 "$(AUTOGEN_DIR)" DIR_SEP "include");


Mime
View raw message