Skip to content

Commit fb13240

Browse files
committed
build: place executable content into the root of the build
Adjust the output location of the generated executable content to the root of the build tree. This is needed primarily on Windows where there is no concept of a RPATH, and the current directory is scanned for the dependent libraries.
1 parent 90a45ce commit fb13240

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ set(CMAKE_CXX_STANDARD 11)
1919

2020
set(CMAKE_C_VISIBILITY_PRESET hidden)
2121

22+
# NOTE(compnerd) this is a horrible workaround for Windows to ensure that the
23+
# tests can run as there is no rpath equivalent and `PATH` is used to lookup the
24+
# libraries.
25+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
26+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
27+
2228
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
2329
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
2430
find_package(Threads REQUIRED)

0 commit comments

Comments
 (0)