Build file updates

* Add gcc compiler flags only on GCC and add O2 for RELWITHDEBINFO

* Don't propagate compiler flags to projects using lib

* Add missing cinttypes include
This commit is contained in:
GeorgH93
2024-10-17 16:46:14 +02:00
committed by GitHub
parent f569f292f7
commit 358168a4c5
3 changed files with 11 additions and 8 deletions

View File

@@ -38,8 +38,10 @@ else(MSVC)
-Wall
-Wextra
-Wpedantic
$<$<CONFIG:RELEASE>:-O2>
$<$<CONFIG:DEBUG>:-O0 -g -p -pg>)
$<$<OR:$<CONFIG:RELEASE>,$<CONFIG:RELWITHDEBINFO>>:-O2>
$<$<CONFIG:DEBUG>:-O0 -g>
$<$<AND:$<CONFIG:DEBUG>,$<CXX_COMPILER_ID:GNU>>:-p -pg>
)
list(APPEND compiler_definitions
CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS

View File

@@ -23,9 +23,9 @@ generate_export_header(${PROJECT_NAME})
set_target_properties(${PROJECT_NAME} PROPERTIES
DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}
MSVC_RUNTIME_LIBRARY "${CMAKE_MSVC_RUNTIME_LIBRARY}")
target_compile_options(${PROJECT_NAME} PUBLIC ${compiler_options})
target_compile_definitions(${PROJECT_NAME} PUBLIC ${compiler_definitions})
target_link_options(${PROJECT_NAME} PUBLIC ${linker_flags})
target_compile_options(${PROJECT_NAME} PRIVATE ${compiler_options})
target_compile_definitions(${PROJECT_NAME} PRIVATE ${compiler_definitions})
target_link_options(${PROJECT_NAME} PRIVATE ${linker_flags})
target_include_directories(${PROJECT_NAME}
PRIVATE
@@ -47,9 +47,9 @@ add_library(${PROJECT_NAME}las ${LIBRARY_TYPE}
set_target_properties(${PROJECT_NAME}las PROPERTIES
DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}
MSVC_RUNTIME_LIBRARY "${CMAKE_MSVC_RUNTIME_LIBRARY}")
target_compile_options(${PROJECT_NAME}las PUBLIC ${compiler_options})
target_compile_definitions(${PROJECT_NAME}las PUBLIC ${compiler_definitions})
target_link_options(${PROJECT_NAME}las PUBLIC ${linker_flags})
target_compile_options(${PROJECT_NAME}las PRIVATE ${compiler_options})
target_compile_definitions(${PROJECT_NAME}las PRIVATE ${compiler_definitions})
target_link_options(${PROJECT_NAME}las PRIVATE ${linker_flags})
target_include_directories(${PROJECT_NAME}las
PRIVATE

View File

@@ -44,6 +44,7 @@
#include <memory>
#include <string>
#include <vector>
#include <cinttypes>
#ifndef DOXYGEN // Doxygen is not handling namespaces well in @includelineno commands, so disable
namespace e57