Skip to content

Commit

Permalink
update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzzhHe committed Aug 7, 2024
1 parent ecdb542 commit c877b4d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ tools/opensbi/build
.idea
3rd
Doxyfile
src/include/config.h
include/config.h
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ set(LOG_FILE_MAX_COUNT 8)
# 生成配置头文件
configure_file(
"${PROJECT_SOURCE_DIR}/cmake/config.h.in"
"${PROJECT_SOURCE_DIR}/src/include/config.h"
"${PROJECT_SOURCE_DIR}/include/config.h"
)

# 添加要编译的目录
Expand Down
2 changes: 1 addition & 1 deletion include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static constexpr const size_t kNProc = 8;

/// 日志文件路径
static const std::string kLogFilePath =
std::string("/Users/hezhohao/Programming/GitRepo/SimpleRenderer/build/logs/SimpleRendererLog.log");
std::string("/Users/hezhohao/Programming/SimpleRenderer/build/logs/SimpleRendererLog.log");
/// 日志文件大小
static constexpr const size_t kLogFileMaxSize = 1024*1024*4;
/// 日志文件数量
Expand Down
26 changes: 8 additions & 18 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,21 @@
# CMakeLists.txt for Simple-XX/SimpleRenderer.

# 生成静态库
add_library(${PROJECT_NAME} STATIC
log_system.cpp
color.cpp
include/vector.hpp
include/matrix.hpp
include/model.hpp
include/shader_base.h
include/default_shader.h
include/light.h
model.cpp
light.cpp
shader_base.cpp
default_shader.cpp
simple_renderer.cpp
file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
"*.cpp"
"*.c"
)
add_library(${PROJECT_NAME} STATIC ${SRC_FILES})

target_include_directories(${PROJECT_NAME} PRIVATE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/include>
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

target_compile_options(${PROJECT_NAME} PRIVATE
${DEFAULT_COMPILE_OPTIONS}
${DEFAULT_COMPILE_OPTIONS}
)

target_link_libraries(${PROJECT_NAME} PRIVATE
${DEFAULT_LINK_LIB}
${DEFAULT_LINK_LIB}
)
43 changes: 0 additions & 43 deletions src/scene.cpp

This file was deleted.

26 changes: 13 additions & 13 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ enable_testing()
include(GoogleTest)

include_directories(
${SimpleRenderer_SOURCE_DIR}/src/include
${SimpleRenderer_SOURCE_DIR}/include
)

list(APPEND DEFAULT_TEST_COMPILE_OPTIONS
${DEFAULT_COMPILE_OPTIONS}
--coverage
${DEFAULT_COMPILE_OPTIONS}
--coverage
)

list(APPEND DEFAULT_TEST_LINK_OPTIONS
--coverage
$<$<CXX_COMPILER_ID:GNU>:
# -fsanitize=leak
>
# -fsanitize=address
-fno-omit-frame-pointer
--coverage
$<$<CXX_COMPILER_ID:GNU>:
# -fsanitize=leak
>
# -fsanitize=address
-fno-omit-frame-pointer
)

link_libraries(
${DEFAULT_LINK_LIB}
gtest_main
${glog_LIBRARIES}
SimpleRenderer
${DEFAULT_LINK_LIB}
gtest_main
${glog_LIBRARIES}
SimpleRenderer
)

# Check if the platform is macOS
Expand Down

0 comments on commit c877b4d

Please sign in to comment.