Skip to content

Commit

Permalink
Conditional example compilation only for unix
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMutta committed Jul 5, 2024
1 parent 5e89479 commit 62909dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
6 changes: 4 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ add_example(xlink_server2 xlink_server2.cpp)
add_example(device_connect_reset device_connect_reset.cpp)

# Local shared memory example
add_example(xlink_server_local xlink_server_local.cpp)
add_example(xlink_client_local xlink_client_local.cpp)
if (UNIX)
add_example(xlink_server_local xlink_server_local.cpp)
add_example(xlink_client_local xlink_client_local.cpp)
endif (UNIX)

10 changes: 0 additions & 10 deletions examples/xlink_client_local.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#if defined(__unix__)

#include <cstring>
#include <cstddef>
#include <fcntl.h>
Expand Down Expand Up @@ -109,11 +107,3 @@ int main(int argc, const char** argv){

return 0;
}

#else

int main() {
return -1;
}

#endif
10 changes: 0 additions & 10 deletions examples/xlink_server_local.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#if defined(__unix__)

#include <cstring>
#include <cstddef>
#include <fcntl.h>
Expand Down Expand Up @@ -106,11 +104,3 @@ int main(int argc, const char** argv){

return 0;
}

#else

int main() {
return -1;
}

#endif

0 comments on commit 62909dc

Please sign in to comment.