Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gsauthof-utility
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
external
gsauthof-utility
Commits
e8d5f19e
Commit
e8d5f19e
authored
1 year ago
by
Georg Sauthoff
Browse files
Options
Downloads
Patches
Plain Diff
Modernize cmake build file
parent
d42ad293
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+33
-56
33 additions, 56 deletions
CMakeLists.txt
libixxx
+1
-1
1 addition, 1 deletion
libixxx
libixxxutil
+1
-1
1 addition, 1 deletion
libixxxutil
with
35 additions
and
58 deletions
CMakeLists.txt
+
33
−
56
View file @
e8d5f19e
...
@@ -16,16 +16,16 @@ add_subdirectory(libixxx)
...
@@ -16,16 +16,16 @@ add_subdirectory(libixxx)
add_subdirectory
(
libixxxutil
)
add_subdirectory
(
libixxxutil
)
if
((
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
if
((
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
AND CMAKE_C_COMPILER_VERSION VERSION_LESS
"5"
)
AND CMAKE_C_COMPILER_VERSION VERSION_LESS
"5"
)
OR
OR
(
CMAKE_C_COMPILER_ID STREQUAL
"Clang"
(
CMAKE_C_COMPILER_ID STREQUAL
"Clang"
AND CMAKE_C_COMPILER_VERSION VERSION_LESS
"4"
)
AND CMAKE_C_COMPILER_VERSION VERSION_LESS
"4"
)
)
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
set
(
NO_SANITIZE
"-fno-sanitize=address"
)
set
(
NO_SANITIZE
"-fno-sanitize=address"
)
endif
()
endif
()
else
()
else
()
set
(
NO_SANITIZE
"-fno-sanitize=all"
)
set
(
NO_SANITIZE
"-fno-sanitize=all"
)
endif
()
endif
()
check_library_exists
(
c clock_gettime
""
CLOCK_GETTIME_IN_C
)
check_library_exists
(
c clock_gettime
""
CLOCK_GETTIME_IN_C
)
...
@@ -36,101 +36,78 @@ else()
...
@@ -36,101 +36,78 @@ else()
endif
()
endif
()
add_executable
(
silence silence.c
)
add_executable
(
silence silence.c
)
set_property
(
TARGET silence PROPERTY COMPILE_DEFINITIONS
_GNU_SOURCE
)
target_compile_definitions
(
silence PRIVATE
_GNU_SOURCE
)
add_executable
(
fail test/fail.c
)
add_executable
(
fail test/fail.c
)
add_executable
(
silencce silence.cc
)
add_executable
(
silencce silence.cc
)
# not necessary, e.g. on Fedora 26
#set_property(TARGET silencce PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)
set_property
(
TARGET silencce PROPERTY INCLUDE_DIRECTORIES
${
CMAKE_SOURCE_DIR
}
/libixxx
${
CMAKE_SOURCE_DIR
}
/libixxxutil
)
target_link_libraries
(
silencce
target_link_libraries
(
silencce
ixxxutil_static
ixxxutil_static
ixxx_static
ixxx_static
)
)
add_executable
(
oldprocs oldprocs.cc
)
add_executable
(
oldprocs oldprocs.cc
)
set_property
(
TARGET oldprocs PROPERTY INCLUDE_DIRECTORIES
${
CMAKE_SOURCE_DIR
}
/libixxx
${
CMAKE_SOURCE_DIR
}
/libixxxutil
)
target_link_libraries
(
oldprocs
target_link_libraries
(
oldprocs
ixxxutil_static
ixxxutil_static
ixxx_static
ixxx_static
)
)
add_executable
(
lockf lockf.c
)
add_executable
(
lockf lockf.c
)
add_executable
(
dcat dcat.cc
)
add_executable
(
dcat dcat.cc
)
set_property
(
TARGET dcat PROPERTY INCLUDE_DIRECTORIES
${
CMAKE_SOURCE_DIR
}
/libixxx
${
CMAKE_SOURCE_DIR
}
/libixxxutil
)
target_link_libraries
(
dcat
target_link_libraries
(
dcat
ixxxutil_static
ixxxutil_static
ixxx_static
ixxx_static
)
)
add_executable
(
swap swap.c
)
add_executable
(
swap swap.c
)
set_property
(
TARGET swap PROPERTY INCLUDE_DIRECTORIES
${
CMAKE_BINARY_DIR
}
)
target_include_directories
(
swap PRIVATE
${
CMAKE_BINARY_DIR
}
)
add_executable
(
pargs pargs.c
)
add_executable
(
pargs pargs.c
)
set_property
(
TARGET pargs PROPERTY COMPILE_DEFINITIONS
_GNU_SOURCE
)
target_compile_definitions
(
pargs PRIVATE
_GNU_SOURCE
)
add_executable
(
pargs32 pargs.c
)
add_executable
(
pargs32 pargs.c
)
set_property
(
TARGET pargs32 PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE
)
target_compile_definitions
(
pargs32 PRIVATE _GNU_SOURCE
)
set_target_properties
(
pargs32
target_compile_options
(
pargs32 PRIVATE -m32
${
NO_SANITIZE
}
)
PROPERTIES COMPILE_FLAGS
"-m32
${
NO_SANITIZE
}
"
target_link_options
(
pargs32 PRIVATE -m32
${
NO_SANITIZE
}
)
LINK_FLAGS
"-m32
${
NO_SANITIZE
}
"
)
# NOTE: when compiling with sanitizers (address etc.) it's important
# NOTE: when compiling with sanitizers (address etc.) it's important
# that these test programs are compiled without those flags because
# that these test programs are compiled without those flags because
# we need to create some core files of them.
# we need to create some core files of them.
# Apparently, the sanitizing might blow up the core files, i.e. yielding:
# Apparently, the sanitizing might blow up the core files, i.e. yielding:
# warning: Failed to write corefile contents (No space left on device).
# warning: Failed to write corefile contents (No space left on device).
add_executable
(
snooze test/snooze.c
)
add_executable
(
snooze test/snooze.c
)
set_target_properties
(
snooze
target_compile_options
(
snooze PRIVATE
${
NO_SANITIZE
}
)
PROPERTIES COMPILE_FLAGS
"
${
NO_SANITIZE
}
"
LINK_FLAGS
"
${
NO_SANITIZE
}
"
)
target_link_options
(
snooze PRIVATE
${
NO_SANITIZE
}
)
add_executable
(
snooze32 test/snooze.c
)
add_executable
(
snooze32 test/snooze.c
)
set_target_properties
(
snooze32
target_compile_options
(
snooze32 PRIVATE -m32
${
NO_SANITIZE
}
)
PROPERTIES COMPILE_FLAGS
"-m32
${
NO_SANITIZE
}
"
target_link_options
(
snooze32 PRIVATE -m32
${
NO_SANITIZE
}
)
LINK_FLAGS
"-m32
${
NO_SANITIZE
}
"
)
add_executable
(
busy_snooze test/busy_snooze.c
)
add_executable
(
busy_snooze test/busy_snooze.c
)
target_compile_options
(
busy_snooze PRIVATE
${
NO_SANITIZE
}
)
set_target_properties
(
busy_snooze
target_link_options
(
busy_snooze PRIVATE
${
NO_SANITIZE
}
)
PROPERTIES COMPILE_FLAGS
"
${
NO_SANITIZE
}
"
LINK_FLAGS
"
${
NO_SANITIZE
}
"
)
target_link_libraries
(
busy_snooze
${
RT_LIB
}
)
target_link_libraries
(
busy_snooze
${
RT_LIB
}
)
add_executable
(
searchb searchb.c
)
add_executable
(
searchb searchb.c
)
add_executable
(
searchbxx searchb.cc
)
add_executable
(
searchbxx searchb.cc
)
set_property
(
TARGET searchbxx PROPERTY INCLUDE_DIRECTORIES
${
CMAKE_SOURCE_DIR
}
/libixxx
${
CMAKE_SOURCE_DIR
}
/libixxxutil
)
target_link_libraries
(
searchbxx
target_link_libraries
(
searchbxx
ixxxutil_static
ixxxutil_static
ixxx_static
ixxx_static
)
)
add_executable
(
exec exec.c
)
add_executable
(
exec exec.c
)
add_executable
(
adjtimex adjtimex.c
)
add_executable
(
adjtimex adjtimex.c
)
add_executable
(
pq pq.cc syscalls.cc
)
add_executable
(
pq pq.cc syscalls.cc
)
set_property
(
TARGET pq PROPERTY INCLUDE_DIRECTORIES
target_link_libraries
(
pq PUBLIC
${
CMAKE_SOURCE_DIR
}
/libixxx
${
CMAKE_SOURCE_DIR
}
/libixxxutil
)
target_link_libraries
(
pq
ixxxutil_static
ixxxutil_static
ixxx_static
ixxx_static
)
)
add_custom_target
(
check-old
add_custom_target
(
check-old
COMMAND env src_dir=
${
CMAKE_CURRENT_SOURCE_DIR
}
COMMAND env src_dir=
${
CMAKE_CURRENT_SOURCE_DIR
}
...
...
This diff is collapsed.
Click to expand it.
libixxx
@
c309c5ff
Compare
16ad3b9c
...
c309c5ff
Subproject commit
16ad3b9cc39f8859289c813748d3b621bcfe0ec6
Subproject commit
c309c5ff18e8a80c68bb79d9d9b7dbc0236ca339
This diff is collapsed.
Click to expand it.
libixxxutil
@
894bb181
Compare
4d35a02e
...
894bb181
Subproject commit
4d35a02edca617d092500be0dae2f740ffc93c73
Subproject commit
894bb1811bb572e053c43f3d240bdd2c310a1fb8
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment