Skip to content

Commit e47283c

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 e47283c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-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)

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ if(ENABLE_SWIFT)
124124
module-maps
125125
DispatchStubs
126126
LINK_FLAGS
127+
-L $<TARGET_LINKER_FILE_DIR:DispatchStubs>
127128
-lDispatchStubs
128129
-L $<TARGET_LINKER_FILE_DIR:BlocksRuntime>
129130
-lBlocksRuntime

0 commit comments

Comments
 (0)