-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
95 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
message("vtx_renderer") | ||
cmake_minimum_required(VERSION 3.23) | ||
include(../util/cmake/configure-target.cmake) | ||
include(cmake/configure-target.cmake) | ||
project(vtx_renderer) | ||
|
||
find_package(vtx_util CONFIG REQUIRED) | ||
|
||
add_library(vtx_renderer) | ||
configureTarget(vtx_renderer) | ||
|
||
file(GLOB_RECURSE HEADERS include/*) | ||
file(GLOB_RECURSE SOURCES src/*) | ||
file(GLOB_RECURSE VENDORS vendor/*) | ||
target_sources(vtx_renderer | ||
PRIVATE ${SOURCES} | ||
PUBLIC FILE_SET public_headers TYPE HEADERS BASE_DIRS include FILES ${HEADERS} | ||
PUBLIC FILE_SET public_vendors TYPE HEADERS BASE_DIRS vendor FILES ${VENDORS}) | ||
|
||
add_library(vtx_renderer STATIC ${HEADERS} ${SOURCES} ${VENDORS}) | ||
configureTarget(vtx_renderer) | ||
target_include_directories(vtx_renderer PUBLIC include) | ||
target_include_directories(vtx_renderer PUBLIC vendor) | ||
target_link_libraries(vtx_renderer PRIVATE vtx_util::vtx_util) | ||
|
||
target_link_libraries(vtx_renderer PRIVATE vtx_util::vtx_util) | ||
install(TARGETS vtx_renderer FILE_SET public_headers FILE_SET public_vendors) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function(configureTarget p_target) | ||
if(CMAKE_COMPILER_IS_GNUCC) | ||
target_compile_options(${p_target} PRIVATE "-Wpedantic") | ||
target_compile_options(${p_target} PRIVATE "-Wall") | ||
elseif(MSVC) | ||
# General. | ||
target_compile_options(${p_target} PRIVATE "/W3") # Warning level 3. | ||
target_compile_options(${p_target} PRIVATE "/WX") # Warnings as errors. | ||
target_compile_options(${p_target} PRIVATE "/MP") # Multicore compilation. | ||
target_compile_options(${p_target} PRIVATE "/sdl") # Additional Security Checks. | ||
target_compile_options(${p_target} PRIVATE "/utf-8") | ||
target_compile_options(${p_target} PRIVATE "/fp:fast") # Floating Point Model. | ||
# Optimization. | ||
target_compile_options(${p_target} PRIVATE "$<$<CONFIG:Release>:/O2>") | ||
target_compile_options(${p_target} PRIVATE "$<$<CONFIG:Release>:/Ob2>") | ||
target_compile_options(${p_target} PRIVATE "$<$<CONFIG:Release>:/Ot>") | ||
target_compile_options(${p_target} PRIVATE "$<$<CONFIG:Release>:/Oi>") | ||
endif() | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function(configureTarget p_target) | ||
if(CMAKE_COMPILER_IS_GNUCC) | ||
target_compile_options(${p_target} PRIVATE "-Wpedantic") | ||
target_compile_options(${p_target} PRIVATE "-Wall") | ||
elseif(MSVC) | ||
# General. | ||
target_compile_options(${p_target} PRIVATE "/W3") # Warning level 3. | ||
target_compile_options(${p_target} PRIVATE "/WX") # Warnings as errors. | ||
target_compile_options(${p_target} PRIVATE "/MP") # Multicore compilation. | ||
target_compile_options(${p_target} PRIVATE "/sdl") # Additional Security Checks. | ||
target_compile_options(${p_target} PRIVATE "/utf-8") | ||
target_compile_options(${p_target} PRIVATE "/fp:fast") # Floating Point Model. | ||
# Optimization. | ||
target_compile_options(${p_target} PRIVATE "$<$<CONFIG:Release>:/O2>") | ||
target_compile_options(${p_target} PRIVATE "$<$<CONFIG:Release>:/Ob2>") | ||
target_compile_options(${p_target} PRIVATE "$<$<CONFIG:Release>:/Ot>") | ||
target_compile_options(${p_target} PRIVATE "$<$<CONFIG:Release>:/Oi>") | ||
endif() | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
message("vtx_renderer_test") | ||
cmake_minimum_required(VERSION 3.23) | ||
include(cmake/configure-target.cmake) | ||
project(vtx_renderer_test) | ||
|
||
find_package(vtx_util CONFIG REQUIRED) | ||
find_package(vtx_renderer CONFIG REQUIRED) | ||
find_package(Catch2 REQUIRED) | ||
|
||
add_executable(vtx_renderer_test src/main.cpp) | ||
configureTarget(vtx_renderer_test) | ||
|
||
target_link_libraries(vtx_renderer_test PRIVATE vtx_util::vtx_util) | ||
target_link_libraries(vtx_renderer_test PRIVATE vtx_renderer::vtx_renderer) | ||
target_link_libraries(vtx_renderer_test PRIVATE Catch2::Catch2WithMain) | ||
|
||
include(CTest) | ||
include(Catch) | ||
catch_discover_tests(vtx_renderer_test) | ||
catch_discover_tests(vtx_renderer_test) | ||
|
||
install(TARGETS vtx_renderer_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function(configureTarget p_target) | ||
if(CMAKE_COMPILER_IS_GNUCC) | ||
target_compile_options(${p_target} PRIVATE "-Wpedantic") | ||
target_compile_options(${p_target} PRIVATE "-Wall") | ||
elseif(MSVC) | ||
# General. | ||
target_compile_options(${p_target} PRIVATE "/W3") # Warning level 3. | ||
target_compile_options(${p_target} PRIVATE "/WX") # Warnings as errors. | ||
target_compile_options(${p_target} PRIVATE "/MP") # Multicore compilation. | ||
target_compile_options(${p_target} PRIVATE "/sdl") # Additional Security Checks. | ||
target_compile_options(${p_target} PRIVATE "/utf-8") | ||
target_compile_options(${p_target} PRIVATE "/fp:fast") # Floating Point Model. | ||
# Optimization. | ||
target_compile_options(${p_target} PRIVATE "$<$<CONFIG:Release>:/O2>") | ||
target_compile_options(${p_target} PRIVATE "$<$<CONFIG:Release>:/Ob2>") | ||
target_compile_options(${p_target} PRIVATE "$<$<CONFIG:Release>:/Ot>") | ||
target_compile_options(${p_target} PRIVATE "$<$<CONFIG:Release>:/Oi>") | ||
endif() | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters