* Use `GNUInstallDirs` in order to respect GNU conventions. This is especially important for multi-arch/multi-lib setups. * Specify position independent mode building properly, without using the historic hack of adding `-fPIC` as a definition. This makes the build system more portable. * Only detect C++ (and not C) to slightly speed up configuring. * Specify C++11 mode using modern CMake idioms. * Fix some whitespace issues.
17 lines
530 B
CMake
17 lines
530 B
CMake
set(SOURCES ossource.cpp ../osinclude.h)
|
|
|
|
add_library(OSDependent STATIC ${SOURCES})
|
|
set_property(TARGET OSDependent PROPERTY FOLDER glslang POSITION_INDEPENDENT_CODE ON)
|
|
|
|
# MinGW GCC complains about function pointer casts to void*.
|
|
# Turn that off with -fpermissive.
|
|
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
|
|
target_compile_options(OSDependent PRIVATE -fpermissive)
|
|
endif()
|
|
|
|
if(WIN32)
|
|
source_group("Source" FILES ${SOURCES})
|
|
endif(WIN32)
|
|
|
|
install(TARGETS OSDependent
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|