Cleaned up old static-library stuff from CMakeLists.txt.

This commit is contained in:
Pietro Gagliardi 2018-05-12 23:59:43 -04:00
parent f647dda850
commit 2768fef3ce
4 changed files with 9 additions and 25 deletions

View File

@ -148,34 +148,33 @@ endmacro()
add_subdirectory("common") add_subdirectory("common")
add_subdirectory("${_OSNAME}") add_subdirectory("${_OSNAME}")
add_library(${_LIBUINAME} ${_LIBUI_SOURCES}) add_library(libui ${_LIBUI_SOURCES})
target_include_directories(${_LIBUINAME} target_include_directories(libui
PUBLIC . PUBLIC .
PRIVATE ${_LIBUI_INCLUEDIRS}) PRIVATE ${_LIBUI_INCLUEDIRS})
target_compile_definitions(${_LIBUINAME} target_compile_definitions(libui
PRIVATE ${_LIBUI_DEFS}) PRIVATE ${_LIBUI_DEFS})
# cmake produces this for us by default but only for shared libraries # cmake produces this for us by default but only for shared libraries
target_compile_definitions(${_LIBUINAME} target_compile_definitions(libui
PRIVATE libui_EXPORTS) PRIVATE libui_EXPORTS)
target_compile_options(${_LIBUINAME} target_compile_options(libui
PUBLIC ${_COMMON_CFLAGS} PUBLIC ${_COMMON_CFLAGS}
PRIVATE ${_LIBUI_CFLAGS}) PRIVATE ${_LIBUI_CFLAGS})
# TODO link directories? # TODO link directories?
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
target_link_libraries(${_LIBUINAME} target_link_libraries(libui
PRIVATE ${_LIBUI_LIBS}) PRIVATE ${_LIBUI_LIBS})
endif() endif()
# TODO INTERFACE libs don't inherit to grandhcildren? # TODO INTERFACE libs don't inherit to grandhcildren?
# on Windows the linker for static libraries is different; don't give it the flags # on Windows the linker for static libraries is different; don't give it the flags
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
_target_link_options_private(${_LIBUINAME} _target_link_options_private(libui
_COMMON_LDFLAGS _COMMON_LDFLAGS
_LIBUI_LDFLAGS) _LIBUI_LDFLAGS)
endif() endif()
if(NOT BUILD_SHARED_LIBS) if(NOT BUILD_SHARED_LIBS)
_handle_static()
# TODO figure out a way to tell libui that it's static # TODO figure out a way to tell libui that it's static
target_compile_definitions(${_LIBUINAME} target_compile_definitions(libui
PUBLIC _UI_STATIC) PUBLIC _UI_STATIC)
endif() endif()
if(NOT MSVC) if(NOT MSVC)
@ -200,7 +199,7 @@ if(NOT MSVC)
endif() endif()
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
if(_HASVERSION) if(_HASVERSION)
set_target_properties(${_LIBUINAME} PROPERTIES set_target_properties(libui PROPERTIES
SOVERSION "${_VERSION}") SOVERSION "${_VERSION}")
endif() endif()
endif() endif()

View File

@ -57,11 +57,6 @@ list(APPEND _LIBUI_INCLUDEDIRS
) )
set(_LIBUI_INCLUDEDIRS _LIBUI_INCLUDEDIRS PARENT_SCOPE) set(_LIBUI_INCLUDEDIRS _LIBUI_INCLUDEDIRS PARENT_SCOPE)
set(_LIBUINAME libui PARENT_SCOPE)
macro(_handle_static)
# do nothing
endmacro()
set(_LIBUI_LIBS set(_LIBUI_LIBS
objc "-framework Foundation" "-framework AppKit" objc "-framework Foundation" "-framework AppKit"
PARENT_SCOPE) PARENT_SCOPE)

View File

@ -54,11 +54,6 @@ list(APPEND _LIBUI_INCLUDEDIRS
) )
set(_LIBUI_INCLUDEDIRS _LIBUI_INCLUDEDIRS PARENT_SCOPE) set(_LIBUI_INCLUDEDIRS _LIBUI_INCLUDEDIRS PARENT_SCOPE)
set(_LIBUINAME libui PARENT_SCOPE)
macro(_handle_static)
# do nothing
endmacro()
# TODO the other variables don't work? # TODO the other variables don't work?
set(_LIBUI_CFLAGS set(_LIBUI_CFLAGS
${GTK_CFLAGS} ${GTK_CFLAGS}

View File

@ -74,11 +74,6 @@ list(APPEND _LIBUI_INCLUDEDIRS
) )
set(_LIBUI_INCLUDEDIRS _LIBUI_INCLUDEDIRS PARENT_SCOPE) set(_LIBUI_INCLUDEDIRS _LIBUI_INCLUDEDIRS PARENT_SCOPE)
set(_LIBUINAME libui PARENT_SCOPE)
macro(_handle_static)
# do nothing
endmacro()
# TODO prune this list # TODO prune this list
set(_LIBUI_LIBS set(_LIBUI_LIBS
user32 kernel32 gdi32 comctl32 uxtheme msimg32 comdlg32 d2d1 dwrite ole32 oleaut32 oleacc uuid user32 kernel32 gdi32 comctl32 uxtheme msimg32 comdlg32 d2d1 dwrite ole32 oleaut32 oleacc uuid