Skip to content

Commit ddb1c29

Browse files
committed
add OpenMP back
1 parent 8cdb7e2 commit ddb1c29

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

cmake/3rd.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,14 @@ find_package(assimp REQUIRED)
261261
if (NOT assimp_FOUND)
262262
message(FATAL_ERROR "assimp not found.\n"
263263
"Following https://github.com/assimp/assimp to install.")
264+
endif ()
265+
266+
find_package(OpenMP REQUIRED)
267+
if (APPLE)
268+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
269+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
270+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${OPENMP_LIBRARIES} -lomp")
271+
endif ()
272+
if (NOT OpenMP_FOUND)
273+
message(FATAL_ERROR "OpenMP not found. Please install OpenMP.")
264274
endif ()

cmake/compile_config.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ list(APPEND DEFAULT_LINK_LIB
2020
glm::glm
2121
${glog_LIBRARIES}
2222
SDL2::SDL2
23+
OpenMP::OpenMP_CXX
2324
assimp
2425
)

src/simple_renderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ bool SimpleRenderer::render(const Model &model) {
6161
SPDLOG_INFO("render model: {}", model.modelPath());
6262
auto shader = DefaultShader();
6363
auto light = Light();
64-
DrawModel(shader, light, model, 0, 1);
64+
DrawModel(shader, light, model, 1, 0);
6565
return true;
6666
}
6767

0 commit comments

Comments
 (0)