Skip to content

Instantly share code, notes, and snippets.

@azbesthu
Created February 19, 2014 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azbesthu/9084818 to your computer and use it in GitHub Desktop.
Save azbesthu/9084818 to your computer and use it in GitHub Desktop.
diff --git a/tools/qmake/mkspecs/features/gyp_generator.prf b/tools/qmake/mkspecs/features/gyp_generator.prf
index 20cde1d..1366244 100644
--- a/tools/qmake/mkspecs/features/gyp_generator.prf
+++ b/tools/qmake/mkspecs/features/gyp_generator.prf
@@ -164,10 +164,40 @@ GYP_CONTENTS += " ],"
GYP_CONTENTS += " 'actions': ["
for(resourcefile, RESOURCES): GYP_CONTENTS += $$rccAction($$resourcefile)
for(header, MOCABLE_HEADERS): GYP_CONTENTS += $$mocAction($$header)
-GYP_CONTENTS += " ]," \
- " },"
+GYP_CONTENTS += " ],"
+#GYP_CONTENTS += " ]," \
+# " },"
+macx {
+# hardlink for macx
+# macx:QMAKE_POST_LINK += ln -f $$getOutDir()/$$getConfigDir()/$$TARGET_NAME $$getOutDir()/$$getConfigDir()/lib/$$TARGET_NAME
+}
+win32 {
+# hardlink for win32, ninja calles cygwin that wraps ln to mklink
+GYP_CONTENTS += " 'postbuilds': [" \
+ " {" \
+ " 'postbuild_name':'hardlink $$TARGET dll'," \
+ " 'action': [" \
+ " 'ln'," \
+ " '-f'," \
+ " '$$clean_path($$getOutDir()/$$getConfigDir()/$$TARGET_NAME)'," \
+ " '$$clean_path($$getOutDir()/$$getConfigDir()/lib/$$TARGET_NAME)'," \
+ " ]," \
+ " }," \
+ " {" \
+ " 'postbuild_name':'hardlink $$TARGET lib'," \
+ " 'action': [" \
+ " 'ln'," \
+ " '-f'," \
+ " '$$clean_path($$getOutDir()/$$getConfigDir()/$${TARGET_NAME}.lib)'," \
+ " '$$clean_path($$getOutDir()/$$getConfigDir()/lib/$${TARGET}.lib)'," \
+ " ]," \
+ " }," \
+ " ],"
+
+}
-GYP_CONTENTS += " ]," \
+GYP_CONTENTS += " }," \
+ " ]," \
"}"
!build_pass: write_file($$GYPFILE, GYP_CONTENTS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment