summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2020-03-22 13:00:03 +0200
committerAdrian Thurston <thurston@colm.net>2020-03-22 13:03:10 +0200
commitd5b745ef0f7a5b42674918ac204973c582de2297 (patch)
treef5b58f6669e73a3c106d375eff3e050b75b9cd13 /src/main.cc
parent197fdd7e939855e229ff6755b76fe8c52756cbf0 (diff)
downloadcolm-d5b745ef0f7a5b42674918ac204973c582de2297.tar.gz
use a static link with libcolm.a when running out of the source tree
A dynamic link is proving complicated on OSX. When the package is configured to install to a new install location, but make install hasn't happened yet the link fails This may indicate we are not getting the code we think we are. We can eschew all these risks with a static link and reserve dynamic linking for when we are running from the installed location. This patch also includes some testing fixes
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cc b/src/main.cc
index a3a7d2c9..5d6cbac4 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -485,7 +485,7 @@ void compileOutput( const char *argv0, const bool inSource, char *srcLocation )
" -I%s/../aapl"
" -I%s/include"
" -L%s"
- " -Wl,-rpath,%s",
+ " %s/libcolm.a",
binaryFn, intermedFn, srcLocation,
srcLocation, location, location );
}
@@ -510,7 +510,9 @@ void compileOutput( const char *argv0, const bool inSource, char *srcLocation )
strcat( command, " -L" );
strcat( command, *lp );
}
- strcat( command, " -lcolm" );
+
+ if ( !inSource )
+ strcat( command, " -lcolm" );
if( !compileOutputCommand( command ) && run )
runOutputProgram();