Skip to content

Commit e01141c

Browse files
committed
[rsl] Statically link riistudio_rs
Seems we no longer need it as a .dll as a workaround
1 parent 19fd92a commit e01141c

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

source/cli/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ elseif (APPLE)
5050
set(GLFW_VERSION "3.4")
5151
set(FREETYPE_VERSION "2.13.2")
5252

53-
SET_TARGET_PROPERTIES(cli PROPERTIES LINK_FLAGS "-framework CoreFoundation -framework Security -ldl ${HOMEBREW_CELLAR}/glfw/${GLFW_VERSION}/lib/libglfw.dylib ${HOMEBREW_CELLAR}/freetype/${FREETYPE_VERSION}/lib/libfreetype.dylib")
53+
SET_TARGET_PROPERTIES(cli PROPERTIES LINK_FLAGS "-framework CoreFoundation -framework Security -framework SystemConfiguration -ldl ${HOMEBREW_CELLAR}/glfw/${GLFW_VERSION}/lib/libglfw.dylib ${HOMEBREW_CELLAR}/freetype/${FREETYPE_VERSION}/lib/libfreetype.dylib")
5454
elseif (UNIX AND NOT EMSCRIPTEN)
5555
find_library(GLFW3_LIBRARY NAMES libglfw.so PATHS /usr/lib)
5656
find_library(FREETYPE_LIBRARY NAMES libfreetype.so PATHS /usr/lib)
@@ -100,7 +100,7 @@ add_custom_command(
100100
add_dependencies(cli rsl)
101101

102102
# Disabled: No DLLs exist
103-
if (WIN32) # AND CMAKE_BUILD_TYPE STREQUAL "Debug"
103+
if (WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
104104
add_custom_command(TARGET cli POST_BUILD
105105
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:cli> $<TARGET_FILE_DIR:cli>
106106
COMMAND_EXPAND_LISTS

source/frontend/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ if (NOT MSVC)
154154
set(GLFW_VERSION "3.4")
155155
set(FREETYPE_VERSION "2.13.2")
156156

157-
SET_TARGET_PROPERTIES(frontend PROPERTIES LINK_FLAGS "-framework CoreFoundation -framework Security -ldl ${HOMEBREW_CELLAR}/glfw/${GLFW_VERSION}/lib/libglfw.dylib ${HOMEBREW_CELLAR}/freetype/${FREETYPE_VERSION}/lib/libfreetype.dylib")
157+
SET_TARGET_PROPERTIES(frontend PROPERTIES LINK_FLAGS "-framework CoreFoundation -framework Security -framework SystemConfiguration -ldl ${HOMEBREW_CELLAR}/glfw/${GLFW_VERSION}/lib/libglfw.dylib ${HOMEBREW_CELLAR}/freetype/${FREETYPE_VERSION}/lib/libfreetype.dylib")
158158
elseif (UNIX)
159159
# --start-group, --end-group allows circular dependencies among object files
160160
if (EMSCRIPTEN)
@@ -285,7 +285,7 @@ if (NOT EMSCRIPTEN)
285285
endif()
286286

287287
# Disabled: No DLLs exist
288-
if (WIN32) # AND CMAKE_BUILD_TYPE STREQUAL "Debug"
288+
if (WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
289289
add_custom_command(TARGET frontend POST_BUILD
290290
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:frontend> $<TARGET_FILE_DIR:frontend>
291291
COMMAND_EXPAND_LISTS

source/rsl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if (WIN32)
2626
endif()
2727

2828
# Annoying bzip2 version conflict (so use dylib)
29-
corrosion_import_crate(MANIFEST_PATH rust/Cargo.toml CRATE_TYPES cdylib FLAGS --crate-type=cdylib)
29+
corrosion_import_crate(MANIFEST_PATH rust/Cargo.toml CRATE_TYPES staticlib FLAGS --crate-type=staticlib)
3030

3131
target_link_libraries(rsl PUBLIC core riistudio_rs vendor)
3232

source/rust_bundle/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ fn main() {
4545
{
4646
println!("cargo:rustc-link-lib=framework={}", "CoreFoundation");
4747
println!("cargo:rustc-link-lib=framework={}", "Security");
48+
println!("cargo:rustc-link-lib=framework={}", "SystemConfiguration");
4849
println!("cargo:rustc-link-search=native={}", "/opt/homebrew/Cellar/freetype/2.13.2/lib/");
4950
println!("cargo:rustc-link-lib=static={}", "freetype");
5051
println!("cargo:rustc-link-search=native={}", "/opt/homebrew/Cellar/glfw/3.4/lib/");

source/tests/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ elseif (APPLE)
5454
set(GLFW_VERSION "3.4")
5555
set(FREETYPE_VERSION "2.13.2")
5656

57-
SET_TARGET_PROPERTIES(tests PROPERTIES LINK_FLAGS "-framework CoreFoundation -framework Security -ldl ${HOMEBREW_CELLAR}/glfw/${GLFW_VERSION}/lib/libglfw.dylib ${HOMEBREW_CELLAR}/freetype/${FREETYPE_VERSION}/lib/libfreetype.dylib")
57+
SET_TARGET_PROPERTIES(tests PROPERTIES LINK_FLAGS "-framework CoreFoundation -framework Security -framework SystemConfiguration -ldl ${HOMEBREW_CELLAR}/glfw/${GLFW_VERSION}/lib/libglfw.dylib ${HOMEBREW_CELLAR}/freetype/${FREETYPE_VERSION}/lib/libfreetype.dylib")
5858
elseif(UNIX AND NOT EMSCRIPTEN)
5959
# TODO: code duplication, extract FindBzip2.cmake to top level CMakeLists
6060
find_library(BZIP2_LIBRARY NAMES libbz2.so PATHS /usr/lib)
@@ -94,12 +94,12 @@ if (WIN32)
9494
$<TARGET_FILE_DIR:tests>
9595
)
9696
# Disabled: No DLLs exist
97-
#if (CMAKE_BUILD_TYPE STREQUAL "Debug")
97+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
9898
add_custom_command(TARGET tests POST_BUILD
9999
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:tests> $<TARGET_FILE_DIR:tests>
100100
COMMAND_EXPAND_LISTS
101101
)
102-
#endif()
102+
endif()
103103
endif()
104104

105105
add_custom_command(

0 commit comments

Comments
 (0)