-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
54 lines (43 loc) · 1.6 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
cmake_minimum_required( VERSION 3.5 )
project( nosys VERSION 0.1 LANGUAGES C CXX )
set(PROJECT_DESCRIPTION "C++ platform framework backend abstration")
include(GNUInstallDirs)
include(CheckIncludeFileCXX)
if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE )
endif()
set( CMAKE_C_STANDARD 23 )
set( CMAKE_C_STANDARD_REQUIRED ON )
set( CMAKE_CXX_STANDARD 26 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
if( NOT CMAKE_BUILD_TYPE STREQUAL Debug )
add_compile_options(-O3)
else()
add_compile_options(-O0 -g)
endif()
add_compile_options(-march=sandybridge -mno-avx -mfpmath=sse)
add_compile_options(-D_FILE_OFFSET_BITS=64)
add_compile_options(-fdata-sections)
add_compile_options(-fpermissive)
add_compile_options(-ffunction-sections)
add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Wpedantic)
add_compile_options(-Wno-unused)
add_compile_options(-Wno-unused-result)
add_compile_options(-Wno-format-contains-nul)
add_link_options(-Wl,--gc-sections)
add_link_options(-Wl,--print-gc-sections)
add_link_options(-Wl,-s)
find_package(OpenGL REQUIRED)
add_library( nosys INTERFACE )
target_include_directories( nosys INTERFACE
PUBLIC_HEADER $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries( nosys INTERFACE m OpenGL::OpenGL OpenGL::GLU glfw GLC )
add_executable( example_c examples/example.c )
target_link_libraries( example_c PUBLIC nosys )
install(FILES ${PROJECT_SOURCE_DIR}/include/nosys.h DESTINATION
${CMAKE_INSTALL_INCLUDEDIR} COMPONENT headers
)