Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
use option() rather than set()
  • Loading branch information
breznak committed Oct 30, 2019
1 parent fd6ae19 commit c9f2ff0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set($ENV{HTM_CPP} ${REPOSITORY_DIR})
option(FORCE_CPP11 "Force compiler to use C++11 standard." OFF)
option(FORCE_BOOST "Force compiler to install and use Boost." OFF)
set(BINDING_BUILD "none" CACHE STRING "Specify the Binding to build 'Python2','Python3' or 'none', default 'none'." )
set(NTA_LIBC_MUSL OFF CACHE BOOL "Are we using MUSL stdlibc++, or GLIBC?")
option(NTA_LIBC_MUSL "Are we using MUSL stdlibc++? otherwise GLIBC" OFF)

# Note: by setting the CXX environment variable, a non-default c++ compiler can be specified.

Expand Down
1 change: 0 additions & 1 deletion CommonCompilerConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ else()
-DHAVE_CONFIG_H
-DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
-DBOOST_NO_WREGEX
-DNTA_LIBC_MUSL=${NTA_LIBC_MUSL}
)

if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
Expand Down
14 changes: 3 additions & 11 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ add_library(${src_lib_static} STATIC $<TARGET_OBJECTS:${src_objlib}>)
if(MSVC)
set_property(TARGET ${src_lib_static} PROPERTY LINK_LIBRARIES ${INTERNAL_LINKER_FLAGS})
elseif(${NTA_LIBC_MUSL})
message("Doing static build with MUSL libc")
message("Doing static build with MUSL libc ${COMMON_COMPILER_DEFINITIONS}")
target_link_libraries(${src_lib_static} -static)
endif()
#
Expand Down Expand Up @@ -335,11 +335,7 @@ target_link_libraries(${src_executable_hotgym}
# link with ${src_lib_shared} rather than ${core_library}

target_compile_options( ${src_executable_hotgym} PUBLIC ${INTERNAL_CXX_FLAGS})
if(${NTA_LIBC_MUSL})
target_compile_definitions(${src_executable_hotgym} PRIVATE ${COMMON_COMPILER_DEFINITIONS} -DNTA_LIBC_MUSL=${NTA_LIBC_MUSL})
else()
target_compile_definitions(${src_executable_hotgym} PRIVATE ${COMMON_COMPILER_DEFINITIONS})
endif()
target_compile_definitions(${src_executable_hotgym} PRIVATE ${COMMON_COMPILER_DEFINITIONS})
target_include_directories(${src_executable_hotgym} PRIVATE
${CORE_LIB_INCLUDES}
${EXTERNAL_INCLUDES}
Expand All @@ -363,11 +359,7 @@ else()
${COMMON_OS_LIBS}
)
target_compile_options( ${src_dyn_executable_hotgym} PUBLIC ${INTERNAL_CXX_FLAGS})
if(${NTA_LIBC_MUSL})
target_compile_definitions(${src_dyn_executable_hotgym} PRIVATE ${COMMON_COMPILER_DEFINITIONS} -DNTA_LIBC_MUSL=${NTA_LIBC_MUSL})
else()
target_compile_definitions(${src_dyn_executable_hotgym} PRIVATE ${COMMON_COMPILER_DEFINITIONS})
endif()
target_compile_definitions(${src_dyn_executable_hotgym} PRIVATE ${COMMON_COMPILER_DEFINITIONS})
target_include_directories(${src_dyn_executable_hotgym} PRIVATE
${CORE_LIB_INCLUDES}
${EXTERNAL_INCLUDES}
Expand Down
6 changes: 1 addition & 5 deletions src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,7 @@ target_include_directories(${unit_tests_executable} PRIVATE
${gtest_INCLUDE_DIRS}
${CORE_LIB_INCLUDES}
${EXTERNAL_INCLUDES})
if(${NTA_LIBC_MUSL})
target_compile_definitions(${unit_tests_executable} PRIVATE ${COMMON_COMPILER_DEFINITIONS} -DNTA_LIBC_MUSL=${NTA_LIBC_MUSL})
else()
target_compile_definitions(${unit_tests_executable} PRIVATE ${COMMON_COMPILER_DEFINITIONS})
endif()
target_compile_definitions(${unit_tests_executable} PRIVATE ${COMMON_COMPILER_DEFINITIONS})
target_compile_options(${unit_tests_executable} PUBLIC ${INTERNAL_CXX_FLAGS})
add_dependencies(${unit_tests_executable} ${core_library})
#add_dependencies(${unit_tests_executable} ${src_lib_shared})
Expand Down

0 comments on commit c9f2ff0

Please sign in to comment.