@@ -378,14 +378,14 @@ if installSetup.headers or installSetup.libraries:
378
378
include_bsonh_test ,
379
379
])
380
380
381
- # Compile the example files to .o so that we can link them twice: once statically, once shared.
382
- exampleObjMap = [(target , clientEnv .Object (source )) for (target , source ) in exampleSourceMap ]
383
-
384
381
staticClientEnv = clientEnv .Clone ()
385
382
staticClientEnv .PrependUnique (LIBDEPS = [mongoClientStaticLib ])
383
+ staticClientEnv .AppendUnique (CPPDEFINES = ['STATIC_LIBMONGOCLIENT' ])
386
384
387
385
# Build each statically linked client program
388
- staticClientPrograms = [staticClientEnv .Program (target , obj ) for (target , obj ) in exampleObjMap ]
386
+ staticClientPrograms = [
387
+ staticClientEnv .Program (target , source ) for (target , source ) in exampleSourceMap
388
+ ]
389
389
390
390
# Install them to the root, and append the install targets to the list of client tests
391
391
clientTests = staticClientEnv .Install ("#/" , staticClientPrograms )
@@ -402,6 +402,10 @@ if buildShared:
402
402
LIBDEPS = mongoClientLibDeps ,
403
403
)
404
404
405
+ # Pretend that these files are shared object suffixed so they don't conflict with the objects
406
+ # for the static library.
407
+ sharedClientEnv ['OBJSUFFIX' ] = sharedClientEnv ['OBJSUFFIX' ] + 's'
408
+
405
409
# Deal with the different lookup models between regular UNIX and Darwin. For regular unix,
406
410
# we set $ORIGIN to pull the copy we run against from the current directory
407
411
# (#/sharedclient). On Darwin, the staged copy of the mongoclient dylib in #sharedclient
@@ -412,13 +416,14 @@ if buildShared:
412
416
RPATH = [sharedClientEnv .Literal ("\\ $$ORIGIN" )])
413
417
414
418
sharedClientPrograms = [
415
- sharedClientEnv .Program ("sharedclient/" + target , obj ) for (target , obj ) in exampleObjMap ]
419
+ sharedClientEnv .Program (
420
+ "sharedclient/" + target , source ) for (target , source ) in exampleSourceMap ]
416
421
libEnv .Depends (sharedClientPrograms , mongoClientInstalls )
417
422
418
423
sharedClientProgramInstalls = sharedClientEnv .Install ("#/sharedclient" , sharedClientPrograms )
419
424
clientTests .extend (sharedClientProgramInstalls )
420
425
421
- clientEnv .Alias ('clientTests' , clientTests , [] )
426
+ clientEnv .Alias ('clientTests' , clientTests )
422
427
423
428
# NOTE: There must be a mongod listening on 127.0.0.1:27999 (the traditional mongodb smoke test
424
429
# port) for the smokeClient target to run. In the server repo that is no problem, the smoke.py
0 commit comments