Skip to content

Commit

Permalink
Merge pull request #164 from schrieveslaach/build-env-improvement
Browse files Browse the repository at this point in the history
More Idiomatic Use of CMake
  • Loading branch information
greymfm authored Sep 16, 2024
2 parents 49871c9 + 55acdbe commit bf1e6ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion alfred/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ endif()

# find_path (LIBNL_INCLUDE_DIR netlink/netlink.h libnl3)

SET(CMAKE_THREAD_PREFER_PTHREAD TRUE)
SET(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -lbluetooth")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -x c")
# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -x c -I /usr/include/libnl3/")
SET(CMAKE_BUILD_TYPE Debug)
Expand Down Expand Up @@ -87,6 +89,7 @@ set_source_files_properties(${FIRMWARE_PATH}/sunray.ino PROPERTIES COMPILE_FLAGS
## add_definitions("-x c++")
## endif()

target_link_libraries(sunray Threads::Threads;bluetooth)
add_executable(sunray ${pi_sources} ${sunray_cpp} ${sunray_c} ${FIRMWARE_PATH}/sunray.ino)
target_include_directories(sunray PRIVATE src ${FIRMWARE_PATH}/src)
# target_link_libraries(sunray "${CMAKE_SOURCE_DIR}/lib/libarduino_${CMAKE_SYSTEM_PROCESSOR}.a")
Expand Down
1 change: 1 addition & 0 deletions alfred/build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
Empty file removed alfred/build/.placeholder
Empty file.

0 comments on commit bf1e6ac

Please sign in to comment.