mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-30 18:34:34 +01:00
add compiler flags to final executable. reduce the comments
This commit is contained in:
parent
ac1ab394d1
commit
5142365dde
@ -27,32 +27,26 @@ set(IMGUI_BACKEND_SRC
|
|||||||
list(TRANSFORM IMGUI_SRC PREPEND ${IMGUI_DIR})
|
list(TRANSFORM IMGUI_SRC PREPEND ${IMGUI_DIR})
|
||||||
list(TRANSFORM IMGUI_BACKEND_SRC PREPEND ${IMGUI_DIR})
|
list(TRANSFORM IMGUI_BACKEND_SRC PREPEND ${IMGUI_DIR})
|
||||||
|
|
||||||
# compiler flags
|
|
||||||
set(CFLAGS
|
set(CFLAGS
|
||||||
-Wall
|
-Wall
|
||||||
-Werror
|
-Werror
|
||||||
-Wnarrowing
|
-Wnarrowing
|
||||||
-O3
|
-O3
|
||||||
-DNDEBUG)
|
-DNDEBUG)
|
||||||
# necessary graphics libraries
|
|
||||||
set(LDLIBS
|
set(LDLIBS
|
||||||
d3d11
|
d3d11
|
||||||
d3dcompiler
|
d3dcompiler
|
||||||
dwmapi)
|
dwmapi)
|
||||||
|
|
||||||
# add library with the imgui sources
|
# build library with the imgui sources
|
||||||
add_library(imgui_win32_directx11 ${IMGUI_SRC} ${IMGUI_BACKEND_SRC})
|
add_library(imgui_win32_directx11 ${IMGUI_SRC} ${IMGUI_BACKEND_SRC})
|
||||||
# set compiler flags
|
|
||||||
target_compile_options(imgui_win32_directx11 PRIVATE ${CFLAGS})
|
target_compile_options(imgui_win32_directx11 PRIVATE ${CFLAGS})
|
||||||
# link against necessary graphics libraries
|
|
||||||
target_link_libraries(imgui_win32_directx11 PRIVATE ${LDLIBS})
|
target_link_libraries(imgui_win32_directx11 PRIVATE ${LDLIBS})
|
||||||
# include headers from the IMGUI_DIR
|
|
||||||
target_include_directories(imgui_win32_directx11 PRIVATE ${IMGUI_DIR})
|
target_include_directories(imgui_win32_directx11 PRIVATE ${IMGUI_DIR})
|
||||||
|
|
||||||
# finally, build the example main.cpp
|
# finally, build the example main.cpp and link to imgui library created above
|
||||||
add_executable(imgui_win32_directx11_example main.cpp)
|
add_executable(imgui_win32_directx11_example main.cpp)
|
||||||
# link example exe against the imgui library
|
target_compile_options(imgui_win32_directx11_example PRIVATE ${CFLAGS})
|
||||||
target_link_libraries(imgui_win32_directx11_example PRIVATE imgui_win32_directx11)
|
target_link_libraries(imgui_win32_directx11_example PRIVATE imgui_win32_directx11)
|
||||||
# include headers from the IMGUI_DIR and backends
|
|
||||||
target_include_directories(imgui_win32_directx11_example PRIVATE ${IMGUI_DIR} ${IMGUI_DIR}/backends)
|
target_include_directories(imgui_win32_directx11_example PRIVATE ${IMGUI_DIR} ${IMGUI_DIR}/backends)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user