mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
[build] cmake: use default library type for libglassnt, libglass, wpigui, and imgui (#5797)
On Windows, imgui and wpigui need to be static. On Mac, they must be dynamic.
This commit is contained in:
@@ -9,7 +9,7 @@ include(LinkMacOSGUI)
|
||||
#
|
||||
file(GLOB_RECURSE libglass_src src/lib/native/cpp/*.cpp)
|
||||
|
||||
add_library(libglass STATIC ${libglass_src})
|
||||
add_library(libglass ${libglass_src})
|
||||
set_target_properties(libglass PROPERTIES DEBUG_POSTFIX "d" OUTPUT_NAME "glass")
|
||||
set_property(TARGET libglass PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
@@ -30,7 +30,7 @@ install(DIRECTORY src/lib/native/include/ DESTINATION "${include_dest}/glass")
|
||||
#
|
||||
file(GLOB_RECURSE libglassnt_src src/libnt/native/cpp/*.cpp)
|
||||
|
||||
add_library(libglassnt STATIC ${libglassnt_src})
|
||||
add_library(libglassnt ${libglassnt_src})
|
||||
set_target_properties(libglassnt PROPERTIES DEBUG_POSTFIX "d" OUTPUT_NAME "glassnt")
|
||||
set_property(TARGET libglassnt PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
|
||||
@@ -69,15 +69,19 @@ endif()
|
||||
file(GLOB imgui_sources ${imgui_SOURCE_DIR}/*.cpp ${imgui_SOURCE_DIR}/misc/cpp/*.cpp)
|
||||
file(GLOB implot_sources ${implot_SOURCE_DIR}/*.cpp)
|
||||
file(GLOB fonts_sources ${fonts_SOURCE_DIR}/src/*.cpp)
|
||||
add_library(imgui STATIC
|
||||
set(imgui_all_sources
|
||||
${imgui_sources}
|
||||
${implot_sources}
|
||||
${imgui_SOURCE_DIR}/backends/imgui_impl_glfw.cpp
|
||||
${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp
|
||||
${gl3w_BINARY_DIR}/src/gl3w.c
|
||||
${fonts_sources}
|
||||
src/stb_image.cpp
|
||||
)
|
||||
src/stb_image.cpp)
|
||||
if (MSVC)
|
||||
add_library(imgui STATIC ${imgui_all_sources})
|
||||
else()
|
||||
add_library(imgui ${imgui_all_sources})
|
||||
endif()
|
||||
target_compile_definitions(imgui PUBLIC IMGUI_IMPL_OPENGL_LOADER_GL3W)
|
||||
if (MSVC)
|
||||
target_sources(imgui PRIVATE ${imgui_SOURCE_DIR}/backends/imgui_impl_dx11.cpp)
|
||||
|
||||
@@ -8,7 +8,11 @@ file(GLOB wpigui_windows_src src/main/native/directx11/*.cpp)
|
||||
file(GLOB wpigui_mac_src src/main/native/metal/*.mm)
|
||||
file(GLOB wpigui_unix_src src/main/native/opengl3/*.cpp)
|
||||
|
||||
add_library(wpigui STATIC ${wpigui_src})
|
||||
if (MSVC)
|
||||
add_library(wpigui STATIC ${wpigui_src})
|
||||
else()
|
||||
add_library(wpigui ${wpigui_src})
|
||||
endif()
|
||||
set_target_properties(wpigui PROPERTIES DEBUG_POSTFIX "d")
|
||||
set_property(TARGET wpigui PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user