Skip to content

Instantly share code, notes, and snippets.

@azbesthu
Last active August 29, 2015 13:56
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/9083774 to your computer and use it in GitHub Desktop.
Save azbesthu/9083774 to your computer and use it in GitHub Desktop.
$ git diff .
diff --git a/tools/qmake/mkspecs/features/gyp_generator.prf b/tools/qmake/mkspecs/features/gyp_generator.prf
index 20cde1d..ed87270 100644
--- a/tools/qmake/mkspecs/features/gyp_generator.prf
+++ b/tools/qmake/mkspecs/features/gyp_generator.prf
@@ -166,6 +166,42 @@ for(resourcefile, RESOURCES): GYP_CONTENTS += $$rccAction($$resourcefile)
for(header, MOCABLE_HEADERS): GYP_CONTENTS += $$mocAction($$header)
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 += " {" \
+ " 'target_name': '$${TARGET}_hardlink'," \
+ " 'type': 'none'," \
+ " 'dependencies': ['$$TARGET']," \
+ " 'actions': [" \
+ " {" \
+ " 'action_name':'hardlink $$TARGET dll'," \
+ " 'inputs': ['$$clean_path($$getOutDir()/$$getConfigDir()/$$TARGET_NAME)',]," \
+ " 'outputs': ['$$clean_path($$getOutDir()/$$getConfigDir()/lib/$$TARGET_NAME)',]," \
+ " 'action': [" \
+ " 'ln'," \
+ " '-f'," \
+ " '<@(_inputs)'," \
+ " '<@(_outputs)'," \
+ " ]," \
+ " }," \
+ " {" \
+ " 'action_name':'hardlink $$TARGET lib'," \
+ " 'inputs': ['$$clean_path($$getOutDir()/$$getConfigDir()/$${TARGET_NAME}.lib)',]," \
+ " 'outputs': ['$$clean_path($$getOutDir()/$$getConfigDir()/lib/$${TARGET}.lib)',]," \
+ " 'action': [" \
+ " 'ln'," \
+ " '-f'," \
+ " '<@(_inputs)'," \
+ " '<@(_outputs)'," \
+ " ]," \
+ " }," \
+ " ]," \
+ " },"
+}
GYP_CONTENTS += " ]," \
"}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment