This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
|
||||
# enable warnings
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunsafe-buffer-usage")
|
||||
endif()
|
||||
|
||||
|
||||
if(OX_USE_STDLIB AND OX_ENABLE_TRACEHOOK)
|
||||
add_library(
|
||||
OxTraceHook SHARED
|
||||
src/tracehook.cpp
|
||||
)
|
||||
else()
|
||||
add_library(
|
||||
OxTraceHook
|
||||
src/tracehook.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(
|
||||
OxTraceHook PUBLIC
|
||||
$<$<BOOL:${OX_BARE_METAL}>:OX_BARE_METAL>
|
||||
$<$<BOOL:${OX_USE_STDLIB}>:OX_USE_STDLIB>
|
||||
$<$<BOOL:${OX_NODEBUG}>:OX_NODEBUG>
|
||||
)
|
||||
|
||||
add_library(
|
||||
OxStd
|
||||
src/assert.cpp
|
||||
src/bit.cpp
|
||||
src/buffer.cpp
|
||||
src/buildinfo.cpp
|
||||
src/byteswap.cpp
|
||||
src/concepts.cpp
|
||||
src/fmt.cpp
|
||||
src/heapmgr.cpp
|
||||
src/istreamreader.cpp
|
||||
src/math.cpp
|
||||
src/memops.cpp
|
||||
src/random.cpp
|
||||
src/reader.cpp
|
||||
src/substitutes.cpp
|
||||
src/stacktrace.cpp
|
||||
src/string.cpp
|
||||
src/stringview.cpp
|
||||
src/strops.cpp
|
||||
src/trace.cpp
|
||||
src/typetraits.cpp
|
||||
src/uuid.cpp
|
||||
src/vec.cpp
|
||||
)
|
||||
|
||||
if(NOT MSVC)
|
||||
target_compile_options(OxStd PRIVATE -Wsign-conversion)
|
||||
target_compile_options(OxStd PRIVATE -Wconversion)
|
||||
if(${OX_OS_LINUX} AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
target_compile_options(OxStd PUBLIC -export-dynamic)
|
||||
#target_link_options(OxStd PUBLIC -W1,-E)
|
||||
elseif(${OX_OS_FREEBSD})
|
||||
target_link_libraries(
|
||||
OxStd PUBLIC
|
||||
execinfo
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT OX_BARE_METAL)
|
||||
set_property(
|
||||
TARGET
|
||||
OxStd
|
||||
PROPERTY
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(
|
||||
OxStd PUBLIC
|
||||
$<$<BOOL:${OX_USE_STDLIB}>:OX_USE_STDLIB>
|
||||
$<$<BOOL:${OX_NODEBUG}>:OX_NODEBUG>
|
||||
)
|
||||
|
||||
if(NOT WIN32)
|
||||
target_link_libraries(
|
||||
OxStd PUBLIC
|
||||
$<$<CXX_COMPILER_ID:GNU>:$<$<BOOL:${OX_USE_STDLIB}>:dl>>
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(
|
||||
OxStd PUBLIC
|
||||
$<$<CXX_COMPILER_ID:GNU>:gcc>
|
||||
OxTraceHook
|
||||
CityHash
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
OxStd PUBLIC
|
||||
include
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
OxTraceHook PUBLIC
|
||||
include
|
||||
)
|
||||
|
||||
install(
|
||||
DIRECTORY
|
||||
include/ox
|
||||
DESTINATION
|
||||
include
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS OxStd OxTraceHook
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
if(OX_RUN_TESTS)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
Reference in New Issue
Block a user