From 00214e633c6515e583b53dc79ddd33e9e8235564 Mon Sep 17 00:00:00 2001 From: MohamedAG2002 Date: Thu, 22 Aug 2024 01:09:10 +0300 Subject: [PATCH] Update README --- CMakeLists.txt | 28 ++++++++++--------- README.md | 1 + ...tiny_obj_loader.cc => tiny_obj_loader.cpp} | 0 3 files changed, 16 insertions(+), 13 deletions(-) rename libs/tinyobjloader/{tiny_obj_loader.cc => tiny_obj_loader.cpp} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64e57e7..3fa9745 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,30 +20,32 @@ set(LINUX_COMPILER_PATH /usr/bin) set(BUILD_PLATFORM) # Set the platform you want to build for when initially building this cmake file ########################################################## -# Directory-specific variables -########################################################## -set(SRC_DIR ${CMAKE_SOURCE_DIR}/src) -set(ENGINE_SRC_DIR ${CMAKE_SOURCE_DIR}/src/engine) -set(APP_SRC_DIR ${CMAKE_SOURCE_DIR}/src/app) -set(EDITOR_SRC_DIR ${CMAKE_SOURCE_DIR}/src/editor) -set(LIBS_DIR ${CMAKE_SOURCE_DIR}/libs/) -########################################################## - # Build flags. This will be added on later ########################################################## -set(BUILD_FLAGS GLFW_INCLUDE_NONE APP_DEBUG EDITOR_ACTIVE) +set(BUILD_FLAGS GLFW_INCLUDE_NONE) ########################################################## # Defining states depending on the platform +########################################################## if(BUILD_PLATFORM STREQUAL "PLAT_WINDOWS") set(CMAKE_CXX_COMPILER ${WINDOWS_COMPILER_PATH}/x86_64-w64-mingw32-g++) set(CMAKE_C_COMPILER ${WINDOWS_COMPILER_PATH}/x86_64-w64-mingw32-gcc) list(APPEND BUILD_FLAGS PLAT_WINDOWS) elseif(BUILD_PLATFORM STREQUAL "PLAT_LINUX") set(CMAKE_CXX_COMPILER ${LINUX_COMPILER_PATH}/c++) - set(CMAKE_C_COMPILER ${LINUX_COMPILER_PATH}/c) + set(CMAKE_C_COMPILER ${LINUX_COMPILER_PATH}/cc) list(APPEND BUILD_FLAGS PLAT_LINUX) endif() +########################################################## + +# Directory-specific variables +########################################################## +set(SRC_DIR ${CMAKE_SOURCE_DIR}/src) +set(ENGINE_SRC_DIR ${CMAKE_SOURCE_DIR}/src/engine) +set(APP_SRC_DIR ${CMAKE_SOURCE_DIR}/src/app) +set(EDITOR_SRC_DIR ${CMAKE_SOURCE_DIR}/src/editor) +set(LIBS_DIR ${CMAKE_SOURCE_DIR}/libs/) +########################################################## # Sources ########################################################## @@ -137,7 +139,7 @@ set(LIBS_SOURCES ${LIBS_DIR}/imgui/backends/imgui_impl_glfw.cpp ${LIBS_DIR}/imgui/backends/imgui_impl_opengl3.cpp - ${LIBS_DIR}/tinyobjloader/tiny_obj_loader.cc + ${LIBS_DIR}/tinyobjloader/tiny_obj_loader.cpp ) ########################################################## @@ -148,7 +150,7 @@ add_executable(${PROJECT_NAME} ${ENGINE_SOURCES} ${APP_SOURCES} ${EDITOR_SOURCES file(COPY assets DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) target_compile_definitions(${PROJECT_NAME} PRIVATE ${BUILD_FLAGS}) -target_compile_options(${PROJECT_NAME} PRIVATE -lm -Wno-deprecated) +target_compile_options(${PROJECT_NAME} PRIVATE -lm -Wno-deprecated -O3) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) target_include_directories(${PROJECT_NAME} PUBLIC BEFORE ${LIBS_DIR} ${SRC_DIR} ${ENGINE_SRC_DIR} ${APP_SRC_DIR} ${EDITOR_SRC_DIR}) diff --git a/README.md b/README.md index 6012e80..255c319 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Even though this project handles all of its dependencies by building them and ge - MiniAudio - stb_image - stb_truetype +- tinyobjloader However, as mentioned before, there is no need to handle any of these dependencies yourself. They are all--hopefully--ready for use when you clone the repository. diff --git a/libs/tinyobjloader/tiny_obj_loader.cc b/libs/tinyobjloader/tiny_obj_loader.cpp similarity index 100% rename from libs/tinyobjloader/tiny_obj_loader.cc rename to libs/tinyobjloader/tiny_obj_loader.cpp