123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- # LaGUI CMake config file.
- get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
- include(${SELF_DIR}/lagui-targets.cmake)
- get_filename_component(LAGUI_INCLUDE_DIRS "${SELF_DIR}/../../include/lagui" ABSOLUTE)
- if (POLICY CMP0072)
- set(OpenGL_GL_PREFERENCE GLVND)
- endif()
- find_package(OpenGL REQUIRED)
- find_package(X11 REQUIRED)
- find_package(Freetype REQUIRED)
- find_package(GLEW REQUIRED)
- find_package(PNG REQUIRED)
- set(CMAKE_THREAD_PREFER_PTHREAD ON)
- set(THREADS_PREFER_PTHREAD_FLAG ON)
- find_package(Threads REQUIRED)
- if (CMAKE_SYSTEM_NAME MATCHES "Linux")
- set(LAGUI_SHARED_LIBS
- ${X11_LIBRARIES}
- ${X11_X11_LIB}
- ${GLEW_LIBRARIES}
- ${OPENGL_LIBRARY}
- ${FREETYPE_LIBRARIES}
- ${X11_Xfixes_LIB}
- ${X11_Xrandr_LIB}
- ${PNG_LIBRARY}
- m X11 Xi Xcursor
- ${CMAKE_DL_LIBS}
- Threads::Threads
- lagui
- CACHE INTERNAL "LaGUI shared libs"
- )
- set(LAGUI_INCLUDE_DIRS_ALL
- ${CMAKE_SOURCE_DIR}
- ${X11_INCLUDE_DIR}
- ${GLEW_INCLUDE_PATH}
- ${FREETYPE_INCLUDE_DIRS}
- ${LAGUI_INCLUDE_DIRS}
- CACHE INTERNAL "Include dirs of LaGUI and dependencies"
- )
- elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
- set(LAGUI_SHARED_LIBS
- ${GLEW_LIBRARIES}
- ${OPENGL_LIBRARY}
- ${FREETYPE_LIBRARIES}
- ${PNG_LIBRARY}
- ${CMAKE_DL_LIBS}
- Threads::Threads
- lagui shlwapi
- CACHE INTERNAL "LaGUI shared libs"
- )
- set(LAGUI_INCLUDE_DIRS_ALL
- ${CMAKE_SOURCE_DIR}
- ${GLEW_INCLUDE_PATH}
- ${FREETYPE_INCLUDE_DIRS}
- ${LAGUI_INCLUDE_DIRS}
- CACHE INTERNAL "Include dirs of LaGUI and dependencies"
- )
- endif()
- # Build Types
- set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}
- CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel tnsan asan lsan msan ubsan"
- FORCE)
- # ThreadSanitizer
- set(CMAKE_C_FLAGS_TSAN
- "-fsanitize=thread -g -O1"
- CACHE STRING "Flags used by the C compiler during ThreadSanitizer builds."
- FORCE)
- set(CMAKE_CXX_FLAGS_TSAN
- "-fsanitize=thread -g -O1"
- CACHE STRING "Flags used by the C++ compiler during ThreadSanitizer builds."
- FORCE)
- # AddressSanitize
- set(CMAKE_C_FLAGS_ASAN
- "-fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g"
- CACHE STRING "Flags used by the C compiler during AddressSanitizer builds."
- FORCE)
- set(CMAKE_CXX_FLAGS_ASAN
- "-fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g"
- CACHE STRING "Flags used by the C++ compiler during AddressSanitizer builds."
- FORCE)
- # LeakSanitizer
- set(CMAKE_C_FLAGS_LSAN
- "-fsanitize=leak -fno-omit-frame-pointer -g"
- CACHE STRING "Flags used by the C compiler during LeakSanitizer builds."
- FORCE)
- set(CMAKE_CXX_FLAGS_LSAN
- "-fsanitize=leak -fno-omit-frame-pointer -g"
- CACHE STRING "Flags used by the C++ compiler during LeakSanitizer builds."
- FORCE)
- # MemorySanitizer
- set(CMAKE_C_FLAGS_MSAN
- "-fsanitize=memory -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g"
- CACHE STRING "Flags used by the C compiler during MemorySanitizer builds."
- FORCE)
- set(CMAKE_CXX_FLAGS_MSAN
- "-fsanitize=memory -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g"
- CACHE STRING "Flags used by the C++ compiler during MemorySanitizer builds."
- FORCE)
- # UndefinedBehaviour
- set(CMAKE_C_FLAGS_UBSAN
- "-fsanitize=undefined"
- CACHE STRING "Flags used by the C compiler during UndefinedBehaviourSanitizer builds."
- FORCE)
- set(CMAKE_CXX_FLAGS_UBSAN
- "-fsanitize=undefined"
- CACHE STRING "Flags used by the C++ compiler during UndefinedBehaviourSanitizer builds."
- FORCE)
- set(LAGUI_FONTS
- "NotoEmoji-Regular.ttf"
- "NotoSansCJK-Regular.ttc"
- "NotoSansMono-Regular.ttf"
- "NotoSansSymbols-Regular.ttf"
- "NotoSansSymbols2-Regular.ttf"
- )
|