Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

"Build succeeded but target not found": Debug/Release should be autodetected #1077

Closed
saper opened this issue Aug 17, 2015 · 0 comments
Closed

Comments

@saper
Copy link
Member

saper commented Aug 17, 2015

I am currently running node-sass with io.js 3.0 in the debug mode, therefore node-gyp prepares the build in the build/Debug directory.

I need to use the following workaround to avoid the Build succeeded but target not found problem at the end:

diff --git a/scripts/build.js b/scripts/build.js
index 4e726e1..990ba85 100644
--- a/scripts/build.js
+++ b/scripts/build.js
@@ -18,9 +18,9 @@ require('../lib/extensions');
  * @api private
  */

-function afterBuild(options) {
+function afterBuild() {
   var install = process.sass.binaryPath;
-  var target = path.join(__dirname, '..', 'build', options.debug ? 'Debug' : 'Release', 'binding.node');
+  var target = path.join(__dirname, '..', 'build', process.config.target_defaults.default_configuration, 'binding.node');

   mkdir(path.dirname(install), function(err) {
     if (err && err.code !== 'EEXIST') {
@@ -141,7 +141,7 @@ function build(options) {

     proc.on('exit', function(errorCode) {
       if (!errorCode) {
-        afterBuild(options);
+        afterBuild();

         return;
       }

This is not a 100% correct solution since we might be using --node-dir or be otherwise cross-compiling node-sass to some other node engine other than the one currently using. We should ideally get this info back from node-gyp somehow.

Once this is in place we can remove the -d option.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

1 participant