2019-01-09 19:32:28 +01:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Get source files
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
file(GLOB_RECURSE SOURCE_FILES source/*.cpp)
|
|
|
|
file(GLOB_RECURSE HEADER_FILES include/*.hpp ../external/*.hpp)
|
|
|
|
|
|
|
|
foreach(HEADER_FILE ${HEADER_FILES})
|
|
|
|
get_filename_component(HEADER_DIRECTORY ${HEADER_FILE} DIRECTORY)
|
|
|
|
include_directories(${HEADER_DIRECTORY})
|
|
|
|
endforeach(HEADER_FILE)
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Add library
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
add_library(${CMAKE_PROJECT_NAME}_common STATIC ${SOURCE_FILES})
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Compiler flags
|
|
|
|
#------------------------------------------------------------------------------
|
2019-01-20 01:31:44 +01:00
|
|
|
target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -O3 -ffast-math)
|
2019-01-20 00:54:58 +01:00
|
|
|
target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -g -Wall -Wextra -Wfatal-errors -Wno-variadic-macros)
|
2019-01-09 19:32:28 +01:00
|
|
|
target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -DDEBUG_ENABLED)
|
2019-01-20 01:31:44 +01:00
|
|
|
target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -DGLM_FORCE_RADIANS)
|
2019-01-09 19:32:28 +01:00
|
|
|
target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -DSOL_CHECK_ARGUMENTS
|
|
|
|
# -DSOL_SAFE_USERTYPE=1
|
|
|
|
# -DSOL_SAFE_REFERENCES=1
|
|
|
|
# -DSOL_SAFE_FUNCTION_CALLS=1
|
|
|
|
# -DSOL_SAFE_FUNCTION=1
|
|
|
|
# -DSOL_SAFE_NUMERICS=1
|
|
|
|
# -DSOL_SAFE_GETTER=1
|
2019-01-20 01:31:44 +01:00
|
|
|
-DSOL_PRINT_ERRORS=1
|
2019-01-09 19:32:28 +01:00
|
|
|
)
|
|
|
|
|
2019-02-26 15:44:32 +01:00
|
|
|
target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -std=c++14)
|
2019-01-20 01:31:44 +01:00
|
|
|
# target_compile_features(${CMAKE_PROJECT_NAME}_common PRIVATE cxx_std_17)
|
2019-01-09 19:32:28 +01:00
|
|
|
|
2020-01-02 17:35:28 +09:00
|
|
|
# target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -pg)
|
2019-01-20 00:54:58 +01:00
|
|
|
|