Skip to content

Commit 175a0cd

Browse files
committed
Moved linker option to end because on some platforms (FreeBSD, possibly?) it makes a difference
1 parent 92736ce commit 175a0cd

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tests/stabtest/makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
ifeq ($(OS),Windows_NT)
22
EXT=.exe
33
PLATFORM_OPTS=-static
4+
PLATFORM_LD_OPTS=
45
else
56
EXT=
6-
PLATFORM_OPTS=-lrt
7+
PLATFORM_OPTS=
8+
PLATFORM_LD_OPTS=-lrt
79
endif
810

911

1012
default: stabtest$(EXT)
1113

1214
stabtest$(EXT): stabtest.cpp ../../readerwriterqueue.h ../../atomicops.h ../common/simplethread.h ../common/simplethread.cpp makefile
13-
g++ $(PLATFORM_OPTS) -std=c++11 -Wpedantic -Wall -DNDEBUG -O3 stabtest.cpp ../common/simplethread.cpp -o stabtest$(EXT) -pthread -Wl,--no-as-needed
15+
g++ $(PLATFORM_OPTS) -std=c++11 -Wpedantic -Wall -DNDEBUG -O3 stabtest.cpp ../common/simplethread.cpp -o stabtest$(EXT) -pthread $(PLATFORM_LD_OPTS) -Wl,--no-as-needed
1416

1517
run: stabtest$(EXT)
1618
./stabtest$(EXT)

tests/unittests/makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
ifeq ($(OS),Windows_NT)
22
EXT=.exe
33
PLATFORM_OPTS=-static
4+
PLATFORM_LD_OPTS=
45
else
56
EXT=
6-
PLATFORM_OPTS=-lrt
7+
PLATFORM_OPTS=
8+
PLATFORM_LD_OPTS=-lrt
79
endif
810

911

1012
default: unittests$(EXT)
1113

1214
unittests$(EXT): unittests.cpp ../../readerwriterqueue.h ../../atomicops.h ../common/simplethread.h ../common/simplethread.cpp minitest.h makefile
13-
g++ $(PLATFORM_OPTS) -std=c++11 -Wpedantic -Wall -DNDEBUG -O3 -g unittests.cpp ../common/simplethread.cpp -o unittests$(EXT) -pthread -Wl,--no-as-needed
15+
g++ $(PLATFORM_OPTS) -std=c++11 -Wpedantic -Wall -DNDEBUG -O3 -g unittests.cpp ../common/simplethread.cpp -o unittests$(EXT) -pthread $(PLATFORM_LD_OPTS) -Wl,--no-as-needed
1416

1517
run: unittests$(EXT)
1618
./unittests$(EXT)

0 commit comments

Comments
 (0)